DEV Community

Discussion on: Converting C# to VB.Net - Need some help

Collapse
 
bugmagnet profile image
Bruce Axtens

Building on @raphaelgodart 's approach and utilising ValueTuple:

Module Module1
    Private Const sSayLit As String = "SAYLIT"
    Private ReadOnly dict As Dictionary(
            Of String, (Arity As Integer, Proc As [Delegate])
        ) = New Dictionary(
            Of String, (Arity As Integer, Proc As [Delegate])
        ) From {
            {sSayLit, (1, CType(AddressOf Console.WriteLine, Action(Of String)))}
        }

    Sub Main()
        dict(sSayLit).Proc.DynamicInvoke("Hello VB.Net World!")
    End Sub

End Module