Thank you. I didn't realize that if the "default value assigned in the init"
and the "DefaultValue(...)" - if the same - would not write the value out. I
just verified in my sample code and your statements are correct. Thank you.
Where did you learn that the behavior (when they are the same) is NOT to
write out the value?
--
-----------
Thanks,
Steve
"Marc Gravell" wrote:
> Futher to my previous answer, what do you mean "will not serialize"?
> As, no, by definition if you have DefaultValue(false), and the value
> *is* false, then it *won't* go into the file. This is the expected
> behaviour, and is similar to the way the forms designer doesn't write
> code for properties you haven't changed.
>
> If you don't want this behaviour, then either don't specify a
> DefaultValue, else perform the serialization manually using
> IXmlSerializable (IIRC; don't have VS to hand).
>
> Marc
>
>
|