Daniel Cigic <da**********@gmail.comwrote:
If you want to clear all you can just assign null ot event ...
otherwise you can use
Delegate.GetInvocationList() and then Method & Target property to get
MethodInfo of each method.
Strictly speaking, you can't do any of these things for an event. You
*can* do them for delegates - the two are different.
Field-like events in C# (i.e. the ones you get with simple
public event EventHandler Foo;
) create both an event and a field of the relevant delegate type
(EventHandler here). Within the class, any reference to Foo is a
reference to the field. Outside the class, any reference to Foo is a
reference to the event.
Events only have add/remove, a bit like properties only have get/set.
In other words, you can't perform assignment on them, nor get their
invocation lists.
See
http://pobox.com/~skeet/csharp/events.html for more information
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too