Click here to Skip to main content
15,886,063 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
How to get events i attached to Elapsed of System.Timers.Timer class instance?
Posted
Comments
Sergey Alexandrovich Kryukov 10-May-15 11:38am    
You are mixing up events and event handlers. Do you mean the goal of obtaining of the list of all handlers added to an invocation list of some event instance?
Why would you need it?
—SA

1 solution

You can't, or at least you shouldn't be able to - as the events list are in a private member. But you can for debug purposes: http://stackoverflow.com/questions/660480/determine-list-of-event-handlers-bound-to-event[^]

I would not try to use this in production code: the private attribute means that the .NET team are at liberty to change anything about the way this works at any time - so it could well stop working for no reason at all.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900