Convert C# event handling to VB.NET

Posted by Quandary on Stack Overflow See other posts from Stack Overflow or by Quandary
Published on 2010-05-27T14:21:07Z Indexed on 2010/05/27 14:21 UTC
Read the original article Hit count: 398

Filed under:
|
|
|
|

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

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET