Re: Maintain list of attached event handlers (.Net 1.1)
- From: "John Saunders [MVP]" <john.saunders at trizetto.com>
- Date: Tue, 10 Jul 2007 19:08:49 -0400
"Armin Zingler" <az.nospam@xxxxxxxxxx> wrote in message news:eEhlPQzwHHA.3364@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
here's the short version:
How can I remember which event handlers did I attach to which events?
Background:
- I have an object tree. There is one root object, containing sub objects,
containing sub objects, and so on. All the objects in the tree can raise
events.
- In a Form's Load event, I recursively process the object tree and attach
event handlers to all the events of the objects in the tree.
- Whenever an event fires, I detach the event handler. (because it won't fire twice)
Why detach the handler right away? Why not wait until the form closes, then detach them all? Follow the same (visitor) pattern you followed to attach the handlers to detach them.
--
John Saunders [MVP]
.
- Follow-Ups:
- Re: Maintain list of attached event handlers (.Net 1.1)
- From: Armin Zingler
- Re: Maintain list of attached event handlers (.Net 1.1)
- References:
- Maintain list of attached event handlers (.Net 1.1)
- From: Armin Zingler
- Maintain list of attached event handlers (.Net 1.1)
- Prev by Date: Re: Maintain list of attached event handlers (.Net 1.1)
- Next by Date: Re: Maintain list of attached event handlers (.Net 1.1)
- Previous by thread: Re: Maintain list of attached event handlers (.Net 1.1)
- Next by thread: Re: Maintain list of attached event handlers (.Net 1.1)
- Index(es):
Relevant Pages
|
Loading