I am developing a C# application where the majority of the code base is in C# class libraries. I want the application to support saving and loading of XML based project files and be able to determine if any modifications have occurred since the last save.
My current design idea is:
Each class that needs to store settings implements IXmlSerializable.
The application maintains a generic list of IXmlSerializable settings objects and calls ReadXml and WriteXml to save/load the project files.
Each class that stores settings also maintains a Modified flag.
The application can check if the project has been modified by enumerating the generic list of IXmlSerializable objects and checking the Modified flag on each. It can also clear the Modified flag on each after saves.
Is this a good design? Are there any better ones? Perhaps I also need to derive my own interface from IXmlSerializable to add the Modified flag?
thanks, Andy