On Jun 3, 2006, at 12:21 PM, Lisa Sawin wrote:


On Jun 3, 2006, at 11:20 AM, Charles Yeomans wrote:
Passing a reference to the control or window removes the need for a circular reference.

Nice!

You can then implement window behavior as needed in the handler methods. If you need to get the state of other controls in a handler, that's certainly possible. You could do something like CrowdedWindow(b.Window).EditField1.Text. Casting is generally a code smell, but since CrowdedWindowEventHandler is auxiliary to CrowdedWindow, it's a reasonable thing to do in this case.

I guess this is about minimizing nastiness, not eliminating it. Why is this so hard to do beautifully?

You're thinking like a mathematician, not an engineer :)

Actually, this is a fairly elegant solution. Once you implement it or some other design, perhaps you'll be able to refactor it to something better. While designs may be pretty, designing is usually not.

Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to