Following the idea of displaying a class in a PropertyGrid, we can also take a look at how it serializes using the XmlSerializer (see if it serializes at all!). The task looks trivial at first sight:
Of course, there's a gotcha here. You will likely get empty xml files all of the time because usually, the default constructor creates "empty" object. So what we want is to dress the object before serializing them. This is done in a variety of ways depending on the property type:
Of course, this is rather simplistic and may fail on forgotten situations.
Screenshot: ReportAssembly contains collection properties (namespaces, fixtures), which would appear empty if not "dressed".
Page rendered at Saturday, August 09, 2008 4:07:31 AM UTC
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.