In C# is it possible to serialize object with only the modified values?
For example: I have instance of the Button object bind into the PropertyGrid and I want to serialize that Button object with only the changed properties. In C# what was the best approach to archive this?
You can iterate object's properties through reflection, compare it's properties with 'fresh' instance, and write down the difference somehow. But you should address many problems if you choose that path, like
null
handling, serializing non-serializable types, serializing references, etc. Here's just a sketch:A call:
An output: