W
wbekker
Hi,
I'm searching for a good pattern for the following problem:
In a large object tree, all object implement a property called IsDirty.
That flag is set when a property is modified. If a child object is
dirty, the parent object must return IsDirty = true as well. This works.
I now want to have an event on the root object of the tree, that signals
when one object in the tree is set to dirty. What is a good approach for
this?
All i can come up with is a brute fore approach where i get a list of
all the objects in the tree, and subscribe to an event of each object
called something like "DirtyStateChanged".
Ward
I'm searching for a good pattern for the following problem:
In a large object tree, all object implement a property called IsDirty.
That flag is set when a property is modified. If a child object is
dirty, the parent object must return IsDirty = true as well. This works.
I now want to have an event on the root object of the tree, that signals
when one object in the tree is set to dirty. What is a good approach for
this?
All i can come up with is a brute fore approach where i get a list of
all the objects in the tree, and subscribe to an event of each object
called something like "DirtyStateChanged".
Ward