Cool !!
That's it
Thank you very much :-)
By the way:
Very strange thing is that I get all delegates even if there are not added
at the time I call the
whole thing.
If I dynamicly Add a delegate at runtime:
Before I add it the delegate is in the list
AddHandler UserControl11.Test11, AddressOf Me.Test
After Adding it I found the Delegate twice.
Whatever...... That helps me out :-) :-)
"Mattias Sjögren" <ma********************@mvps.org> schrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP09.phx.gbl...
I read something about a "getinvocationlist" Methode for Delegates
which can get this back, but couldN#t found out how it works.
If you define an event called Foo, you'll get a private delegate field
called FooEvent that you can query for the handlers. Like this
Class EventPub
Public Event Foo()
Public Sub ListEm()
For Each d As [Delegate] In FooEvent.GetInvocationList()
Console.WriteLine(d.Method)
Next
End Sub
End Class
In Addition the Delegate/Eventhandler may have a Attributes.
How could I read this.
You can call GetCustomAttributes() on the MethodInfo reference you get
from Delegate.Method.
Mattias
--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.