Re: Registering Event Handlers in C# vs. VB .NET
- From: "Scott M." <smar@xxxxxxxxxxxxx>
- Date: Wed, 2 Jan 2008 21:35:12 -0500
You've missed my point. I'm not saying VB.NET doesn't offer the same
functionality possible elsewhere. I'm saying that the "Handles" keyword
is used in a way that obscures the full capabilities of events. A
particular example of what I mean is the requirement that when using
"Handles" that you have some known object variable (as opposed, for
example, to a collection of objects exposing an event), and of course the
ability to subscribe and unsubscribe at will at run-time.
It's not that you can't do these things in VB.NET, but you have to use an
entirely different syntax to do so from the syntax offered up as the basic
provided mechanism.
I didn't miss your point, but I think that your point doesn't apply as
broadly as you make it sound. If I am developing my own classes and raising
my own events, then the client of these classes won't have any "provided
mechansim" for handling those events. It will be up to the client to
declare the instance "WithEvents" or "AddHandler". I think what you are
referring to is applicable to classes used in UI's, but then (as I said),
they can still be modified to use the other syntax.
I just don't think this is a VB thing. C# also has language elements, such
as "using" that abstract a feature into a new language construct, but the
user can still get at this language functionality in other ways.
Anyway, thanks for your input.
-Scott
.
- Follow-Ups:
- Re: Registering Event Handlers in C# vs. VB .NET
- From: Peter Duniho
- Re: Registering Event Handlers in C# vs. VB .NET
- References:
- Registering Event Handlers in C# vs. VB .NET
- From: Scott M.
- Re: Registering Event Handlers in C# vs. VB .NET
- From: Peter Duniho
- Re: Registering Event Handlers in C# vs. VB .NET
- From: Scott M.
- Re: Registering Event Handlers in C# vs. VB .NET
- From: Peter Duniho
- Registering Event Handlers in C# vs. VB .NET
- Prev by Date: Re: Delegates and Events... please help
- Next by Date: Re: diferent results in debugger
- Previous by thread: Re: Registering Event Handlers in C# vs. VB .NET
- Next by thread: Re: Registering Event Handlers in C# vs. VB .NET
- Index(es):
Relevant Pages
|