We’re writing a .NET 3.5 application, which uses Xml serialization of various objects.
We are basically creating an xml document from an object, and i’d like to be able to use this attribute (DefaultParameterValue) which is what .NET 4.0 is using to implement optional arguments.
I’d like the Xml generated document to contain the default values for the parameters that have this attribute.
Is it possible?
XmlSerializeroperates at the (public) field/property level. In doing so, one of the things it looks at is the similar[DefaultValue(...)]. It does not look at methods at all, except for a few assistance patterns likeShouldSerialize*(). As such, there would seen to be no crossover at all with parameters, ad no need to look at[DefaultParameterValue(...)].