Hi,

the code looks reasonable to me. Using the "Add" method is correct.

I don't know of a better way to propagate an event automatically from a nested class, but would also be interested in one.

By on 4/11/2011 8:10 AM ()

I'm use to install and remove event handler and therfore I really do not know if the simply method ADD defined inside a class remove the event habdler once the class in which it is defined shall be "destroyed"/"disposed".

Have you an idea how to test the above described scenario?

Thanks

ANN

By on 4/16/2011 8:10 AM ()

I believe an instance of MainClass will not be garbage-collected as long as its members are accessible through the event handler function. In other words, instances of MainClass will live at least as long as the instance of NestedClass that they are attached to.

When both a MainClass instance and the associated NestedClass instance become unreachable, both should eventually get garbage-collected.

At least that is what I would expect from a reasonable implementation.

See here for some ideas how to test these things:
[link:stackoverflow.com]

By on 4/19/2011 4:49 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper