C# to VB Conversion Help - Overriding Events?

G

Guest

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 BroadcastedMessageHandler
NewBroadcastedMessage
{
add
{
PersistentEventsHelper.AddEventSink
(value,c_NewBroadcastedMessageEvent);
}

remove
{
PersistentEventsHelper.RemoveEventSink
(value,c_NewBroadcastedMessageEvent);
}
}
 
H

Herfried K. Wagner [MVP]

Spam Catcher said:
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 BroadcastedMessageHandler
NewBroadcastedMessage
{
add
{
PersistentEventsHelper.AddEventSink
(value,c_NewBroadcastedMessageEvent);
}

remove
{
PersistentEventsHelper.RemoveEventSink
(value,c_NewBroadcastedMessageEvent);
}
}

Yes, it's possible in VB 2005 (not in previous version!). Check out 'Custom
Event'.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top