Convert these delegate lines from C # to vb.net
Here I have some code from Fleck that actually works fine in C # (no errors) and this is the line in the class library:
public Action<List<byte>> ReceiveData = delegate { };
then i convert it to vb.net using http://www.developerfusion.com/tools/convert/csharp-to-vb/
and this resulted in:
Public ReceiveData As Action(Of List(Of Byte)) = Function() Do
End Function
but an error occurs:
Do -> Expected Expression
End function -> End function must precede the corresponding function
can anyone tell me what is the valid vb.net code for this? thank
+3
Eldon lesley
source
to share
1 answer
Public ReceiveData As Action(Of List(Of Byte)) = Sub()
End Sub
For conversions, try using SharpDevelop. It can convert between C #, IronPython, Ruby and VB.NET
+4
Alexus
source
to share