Home All Groups Group Topic Archive Search About
Author
20 Jun 2006 10:09 PM
sb
I have a class with a large number of public properties.  Each property has
a DefaultValue associated with it...so that the user can interact with it
using a PropertyGrid control and also reset the individual values via a
context menu.  Everything so far works great...

What I'd like to do now is to manually serialize an object of this class to
a file (xml) and ensure that every property is written to the
file...regardless of whether it has a DefaultValue or not.

I've seen examples online that show how to do this on a property-by-property
basis using the XmlOverrideAttribute....but I want this done for the entire
class.  This seems like it should be an easy task...but it's eluding me.
Also, removing the DefaultValues is not an option I want to consider :)

Any help is greatly appreciated
-sb

AddThis Social Bookmark Button