|
-
Oct 15th, 2004, 06:25 AM
#1
Events, another C# conversion question...
I've come across this in some code that I am converting to VB...
Code:
private static readonly object DockStateChangedEvent = new object();
public event EventHandler DockStateChanged
{
add { Events.AddHandler(DockStateChangedEvent, value); }
remove { Events.RemoveHandler(DockStateChangedEvent, value); }
}
Anyone want to give me a clue as to what it should look like after its converted? Its like a maze, you start from the cheese and work your way back to the mouse.
Last edited by crptcblade; Oct 15th, 2004 at 02:48 PM.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Oct 15th, 2004, 06:38 AM
#2
-
Oct 15th, 2004, 02:17 PM
#3
Hi,
Those seem like event properties, one of the features that I wish VB.Net had. The only way around it is to use the AddHandler/RemoveHandler methods but you can't do it as cleanly as in C#.
Cheers,
NTG
-
Oct 15th, 2004, 02:55 PM
#4
It'd be pretty easy to wrap this in a generic class though. True it would be an extra step but it could be done pretty easily.
Mendhak, fancy having a go at this for The Project?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|