Serializing and Event-Handlers

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hi! I'm about to go nuts over my serializing problem.

This is my situation:

I have a Data-Class that can have children of the same class which are
stored in a hashtable, i.e:
X has A as a child
A has B as a child

When an object is changed it raises an Updated-Event which the
parent-instance reacts upon (handlers are set when the child is added to the
parent's collection). When reacting to an Updated event the (parent) class
raises the same event, i.e. the Updated-Event is passed upwards to all the
parents and "grandparents".

If B changes, A notices and raises an event upon which X reacts.

All is fine. Even, if i serialize X (for example). Before serializing i
remove all handlers and afterwards i set them again.

Problem: after desierializing, A responds to B and (if A ich changed) X
responds to A; but: if A raises the Updated event after getting one from B
then X doesn't react.

After deserializing i (as far as i can tell: correctly) refresh all
collections and instances and add all handlers correctly.

Why doest X respond to A's event, if A is the first one raising it, but not,
if A's event is raised after getting B's event.

X,A,B are all of the same class and the event fired is identical. It works
fine - just not, if I've deserialized?!?

Anybody any hints?!

Thanks! I've been going nuts the last two days - i just don't get it.

Mike ;o)


.