C
Claire
Hi,
Pardon my poor description ahead, I don't know the technical terms.
If I add an event to an event handler from a class that later goes "dead"
without being disposed, what happens when the event is fired?
My TestTemplate class doesnt support IDisposable and just relies on garbage
collection. In its constructor a checkbox is passed in the parameters to it.
I assign a new event hander to the checkbox checkedchanged event to a
function within the class.
I'm not sure whether that assignment would prevent the object being cleared
by GC as it's still held in the checkboxes' checkedchanged event list.
Is there any way to clear all event handlers waiting on an event for a
control?
I have several testtemplate classes that use various combinations of
controls on my form, depending on a test type that's being set up. Each
class has several controls passed to it via the constructor. Theres only
ever a single instance of one of my classes in use. In all cases except this
one, text boxes etc are databound to different fields of a test record and
it's very easy to break data bindings to a control.
I hope u understand me
Pardon my poor description ahead, I don't know the technical terms.
If I add an event to an event handler from a class that later goes "dead"
without being disposed, what happens when the event is fired?
My TestTemplate class doesnt support IDisposable and just relies on garbage
collection. In its constructor a checkbox is passed in the parameters to it.
I assign a new event hander to the checkbox checkedchanged event to a
function within the class.
I'm not sure whether that assignment would prevent the object being cleared
by GC as it's still held in the checkboxes' checkedchanged event list.
Is there any way to clear all event handlers waiting on an event for a
control?
I have several testtemplate classes that use various combinations of
controls on my form, depending on a test type that's being set up. Each
class has several controls passed to it via the constructor. Theres only
ever a single instance of one of my classes in use. In all cases except this
one, text boxes etc are databound to different fields of a test record and
it's very easy to break data bindings to a control.
I hope u understand me