> and the compiler tells me:
> The event 'System.Web.UI.WebControls.CheckBox.CheckedChanged' can only
> appear on the left hand side of += or -=
>
> What might I be doing incorrectly here?
> Is what I want to do even possible?

What are you trying to accomplish functionally?  You can't really do what
you're describing from the 'outside', because the public functionality of an
event is just what the compiler is telling you about: the ability to add or
remove a handler.  What the interal implementation is for that event is off
limits to you - maybe the implementor is leveraging the default
implementation for events, or maybe they've provided custom add/remove
handler that are storing the delegate references being passed to them in a
hashtable or other data structure.  So being able to query whether anyone's
registered for an event (and if so, how many) isn't part of the public
functionality of an event.

Obviously, any class you write that publishes events can also provide a
property or method that provides that information.  But it's not part of the
natural event facilities, so you're not going to see it in the MSFT
framework libs - or most others.

-Mike
Bear Canyon Consulting LLC
http://www.bearcanyon.com
http://www.pluralsight.com/mike

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to