C# to VB Conversion Help - Overriding Events?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Spam Catcher

    #1

    C# to VB Conversion Help - Overriding Events?

    Hi all,

    Is this possible in VB.NET?


    /// <summary>
    /// We manually implement delegate management, so instead of
    /// declaring event variable we declare accessor methods
    /// </summary>
    public override event BroadcastedMess ageHandler
    NewBroadcastedM essage
    {
    add
    {
    PersistentEvent sHelper.AddEven tSink
    (value,c_NewBro adcastedMessage Event);
    }

    remove
    {
    PersistentEvent sHelper.RemoveE ventSink
    (value,c_NewBro adcastedMessage Event);
    }
    }
  • Herfried K. Wagner [MVP]

    #2
    Re: C# to VB Conversion Help - Overriding Events?

    "Spam Catcher" <spamhoneypot@r ogers.comschrie b:
    Is this possible in VB.NET?
    >
    /// <summary>
    /// We manually implement delegate management, so instead of
    /// declaring event variable we declare accessor methods
    /// </summary>
    public override event BroadcastedMess ageHandler
    NewBroadcastedM essage
    {
    add
    {
    PersistentEvent sHelper.AddEven tSink
    (value,c_NewBro adcastedMessage Event);
    }
    >
    remove
    {
    PersistentEvent sHelper.RemoveE ventSink
    (value,c_NewBro adcastedMessage Event);
    }
    }
    Yes, it's possible in VB 2005 (not in previous version!). Check out 'Custom
    Event'.

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

    Comment

    • Spam Catcher

      #3
      Re: C# to VB Conversion Help - Overriding Events?

      "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.atwrot e in
      news:#ON8cRY4GH A.4820@TK2MSFTN GP06.phx.gbl:
      Yes, it's possible in VB 2005 (not in previous version!). Check out
      'Custom Event'.
      That's what I thought - couldn't find anything for .NET 1.1.

      In the end, rewrote the call as 2 sub (add/remove)... works just as well.

      Comment

      Working...