How to get the set events of a control?
- by Jack
It's possible via C# code get an list of methods/delegates that was set to Control? let me explain better..
For example.
Assuming some definitions like this:
foo.Click += (a, b) => { ... }
//..
foo.Click += (A,B) => { ... }
And a megic method:
var baa = foo.GetEvents("Click");
Returns
baa[0] points to (a, b) => { ... }
baa[1] points to (A,B) => { ... }
My scenery: I make and add dynamically event to some controls inside a loop. I want depending to a boolean value a event of control of index one,will removed by using control.Click -= baa[1] or something like this. I hope this is clear for your. Thanks in advance.