Tracking Modified Resources

Going through the issue tracker I can across one that I had added - the ability to know if an attribute resource was modified since it was loaded from or saved to disk.

I was thinking how this could be done and wanted to bounce around a couple ideas.

The simplest would be to have a modified property on the resources (in fact maybe all resources would have this property). All modification methods could mark the resource modified. The issues related to this approach would include:

  • When reading in the resource from disk or stream would generate a lot of modified calls. One way of possibly getting around this would be to provide an optional flag in the modification calls (or provide a duplicate interface that would not call the modified method on the attribute resource)

  • It may not be a single hop to get to the model resource - for example an item or item definition may have to go several levels to reach the attribute resource.

  • Some transient attribute resources may not what to track this and will get hit by the overhead.

Any ideas?