I have a object that dynamically creates a number of child objects. These child objects are derived from UserControl. What is the best method to pass information to pass information back to the parent? In the past I have used the delegate event but recently I have been just using a reference to the parent in the constructer of the child objects.
I do have reservations to tight coupling as I am concerned that the child object may be tied up if the parent fails to execute the referenced method in a timely fashion.
I didn’t want to start a new question so I’ll ask here.
If I have events wired for the dynamically created objects and the object is disposed of at a later time, should I be unwiring the event prior to disposing of the event.
and … if I am keeping my dynamically created objects in an array or hashtable would simply removing that list item dispose of the item from memory.
It will depend on the situation. Events are appropriate if one object wants to observe another and react to particular changes. Simply keeping a reference to the parent is suitable in other situations. If you want advice for a very specific case, please give details of that case.