Convert C# event handling to VB.NET
- by Quandary
Question: The following C# code:
public event RemoteAPI.NotifyCallback Notify
{
add { s_notify = value; }
remove { Console.WriteLine("TODO : Notify remove."); }
}
How do I convert this to VB.NET ?
It implements an interface:
Public Interface ICallsToServer
''' <summary>
''' Function to call the server from the client
''' </summary>
''' <param name="n">Some number</param>
''' <returns>Some interesting text</returns>
Function SomeSimpleFunction(ByVal n As Integer) As String
''' <summary>
''' Add or remove callback destinations on the client
''' </summary>
Event Notify As NotifyCallback
End Interface
The VB.NET automatically generated code was:
Public Event Notify(ByVal s As String) Implements RemoteAPI.ICallsToServer.Notify