473,385 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Retrieve all delegates registered for one event

Hi.

You can add new delegates for an event with += and you can remove delegates
from an event by using: -= but is there a way (method) to list all delegates
added to one event???

Sincerely
Greetings
Lore

Nov 15 '05 #1
2 3053
Hi Lore,

Yes, this is possible.
You can use the GetInvocationList() method in your event,
which returns the list of delegates that have been associated with
the event.

MyDelegate[] delegates = (MyDelegate[])MyEvent.GetInvocationList();

Regards,
Aravind C
"Lore Leuneog" <Lo**********@gmx.net> wrote in message
news:bo*************@news.t-online.com...
Hi.

You can add new delegates for an event with += and you can remove delegates from an event by using: -= but is there a way (method) to list all delegates added to one event???

Sincerely
Greetings
Lore

Nov 15 '05 #2
Hi, Aravind

Thank you very much.
But it seems this doesn't work with build-in Form-Control-Events for example
this.Button.Click-event?
(EventHandler[])this.button.Click.GetInvocationList();
Doesn't work?!

Or did I do it wrong?
Sincerely
Marane

"Aravind C" <ar***********@nospam.hotmail.com> schrieb im Newsbeitrag
news:eL*************@TK2MSFTNGP10.phx.gbl...
Hi Lore,

Yes, this is possible.
You can use the GetInvocationList() method in your event,
which returns the list of delegates that have been associated with
the event.

MyDelegate[] delegates = (MyDelegate[])MyEvent.GetInvocationList();

Regards,
Aravind C
"Lore Leuneog" <Lo**********@gmx.net> wrote in message
news:bo*************@news.t-online.com...
Hi.

You can add new delegates for an event with += and you can remove

delegates
from an event by using: -= but is there a way (method) to list all

delegates
added to one event???

Sincerely
Greetings
Lore


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Lore Leuneog | last post by:
Hi. You can add new delegates for an event with += and you can remove delegates from an event by using: -= but is there a way (method) to list all delegates added to one event??? Sincerely...
0
by: Dave L | last post by:
I just upgraded from VS .NET 2002 to 2003. Everything built okay, but strange bugs started appearing. Apparently there is a bug in the managed C++ compiler in regards to handling of static...
4
by: Tim | last post by:
There are a set of clients who need to be notified of certain events. I have used events and delegates (publisher-Subscriber model) for the notification mechanism. All the clients register with...
30
by: Burkhard | last post by:
Hi, I am new to C# (with long year experience in C++) and I am a bit confused by the language construct of events. What is it I can do with events that I cannot do with delegates? At the moment...
5
by: renjini | last post by:
I am a starter in C# ... I will present my problem : I am wrapping a C dll in C#. The C dll exports a function which takes a structure MYSTRUCT holding 2 function pointers(callback functions)....
0
by: renjini | last post by:
I am a starter in C# ... I will present my problem : I am wrapping a C dll in C#. The C dll exports a function which takes a structure MYSTRUCT holding 2 function pointers(callback...
1
by: CB | last post by:
When designing an object, is there a best practice for how to allow the user of the object to tell the object to remove itself from any delegates / events it has registered with? For example.....
69
by: raylopez99 | last post by:
They usually don't teach you in most textbooks I've seen that delegates can be used to call class methods from classes that are 'unaware' of the delegate, so long as the class has the same...
4
by: samadams_2006 | last post by:
Hello, I'm trying to figure out why delegates are such a great thing. For example, I came across the following line of code: "This ability to refer to a method as a parameter makes delegates...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.