![]() In our example, we use a FileStream object, but this could just as easily have been a NetworkStream object. ![]() This specifies that the Answers collection is to be serialized as an array with an element name of answers.Įach answer in the collection will be serialized as an individual element named answer. However, if the property was not read-only and we didnt want it serialized, we would simply decorated it with the XmlIgnore attribute. Fire emblem radiant dawn emuparadiseĪt the same time, we are also changing the attribute name to something more concise.īy default, the serializer will name any XML elements or attributes exactly as the corresponding property is named, however in our example, we want the elements in lower case. In this case we use it to make sure the element is rendered in lower case.īy default the XML serializer serializes all properties as XML elements.īy using this attribute, we override this behaviour, serializing the properties as attributes instead.
0 Comments
Leave a Reply. |