How can i get the event handler attached to an event?
pseudocode, for example's sake:
public static EventHandler GetChangeUICuesEventHandler(Control SomeControl)
{
EventHandler changeUICuesEventHandler = SomeControl.ChangeUICues;
return changeUICuesEventHandler
}
Sample usage (pseudo-code):
Control control = GetControlByName(Console.ReadLine());
button1.ChangeUICues += GetChangeUICuesEventHandler(control);
I offer up the following as an alternative path rather than a direct answer... So here goes...
Can you approach this a little differently perhaps by ensuring that your control with the event handler already attached, in this case the parameter
someControl
, instead implements an interface that defines the attached handler. For example:Then you could use it like so: