Tengo el siguiente código en C#
*** CSharp
public class PersonData
{
private delegate void updateDelegate(ArrayList list);
public static void upList(ArrayList list)
{
PersonData pd = new PersonData();
updateDelegate del = new updateDelegate(pd.updateList);
del.BeginInvoke(list, null, null);
}
}
al intentar traducirlo a VB
*** VB
Public Class PersonData
Private Delegate Sub UpdateDelegate(ByVal list As ArrayList)
Public Shared Sub UpList(ByVal list As ArrayList)
Dim pd As PersonData = New PersonData
Dim del As UpdateDelegate = AddressOf UpdateList
del.BeginInvoke(list, Nothing, Nothing)
End Sub
End Class
me da el siguiente error en la línea:
Dim del As UpdateDelegate = AddressOf UpdateList
No se puede hacer referencia a un miembro de instancias de una clase
desde un método compartido o un inicializador de métodos compartido
sin una instancia explícita de la clase.
¿Alguien tiene idea de como tendría que tratar este tema? Manteniendo
el procedimiento de tipo "Shared" porsupuesto.
Leer las respuestas