When I, let's say I'm a form, register myself for an event, I use a syntax
such as:
Class1.EventNam e += new EventNameHandle r(MyFormsEventH andler);
Somewhere in global scope, I have defined the delegate EventNameHandle r:
public delegate void EventNameHandle r(object source, Eventargs e);
In Class1 I have:
public static event EventNameHandle r EventName;
I assume that the event EventName keeps track of all of the EventNameHandle r
delegates that are register with it. But who unregisters the delegate when
my form is destroyed? Can someone please explain?
Regards,
David Rogers
such as:
Class1.EventNam e += new EventNameHandle r(MyFormsEventH andler);
Somewhere in global scope, I have defined the delegate EventNameHandle r:
public delegate void EventNameHandle r(object source, Eventargs e);
In Class1 I have:
public static event EventNameHandle r EventName;
I assume that the event EventName keeps track of all of the EventNameHandle r
delegates that are register with it. But who unregisters the delegate when
my form is destroyed? Can someone please explain?
Regards,
David Rogers
Comment