System.Xml
[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]
1.0.5000.0
2.0.0.0
4.0.0.0
To be added
System.Object
Creating the is part of a process that overrides the default way the serializes class instances. For example, suppose you want to serialize an object that is created from a DLL which has an inaccessible source. By using the , you can augment or otherwise control how the object is serialized.
The members of the class correspond directly to a family of attribute classes that control serialization. For example, the property must be set to an , which allows you to override serialization of a field or property by instructing the to serialize the property value as XML text. For a complete list of attributes that control serialization, see the .
For more details on using the with the class, see How to: Specify an Alternate Element Name for an XML Stream.
Represents a collection of attribute objects that control how the serializes and deserializes an object.
Constructor
1.0.5000.0
2.0.0.0
4.0.0.0
To be added
Initializes a new instance of the class.
Constructor
1.0.5000.0
2.0.0.0
4.0.0.0
Use the default constructor for the class, rather than using this constructor.
Initializes a new instance of the class and customizes how the serializes and deserializes an object.
A class that can provide alternative implementations of attributes that control XML serialization.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Xml.Serialization.XmlAnyAttributeAttribute
To be added: an object of type 'XmlAnyAttributeAttribute'
The can be applied to a member that returns an array of objects on deserialization. This allows the to deserialize any attributes that do not have a corresponding member in the object being deserialized--thus those elements are "unknown" to the . This is useful when the XML stream has been altered by an XML Web service, or when it is known that random data is always included with the XML stream.
The property allows you to override the serialization of a member to which the has been applied.
Gets or sets the to override.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Xml.Serialization.XmlAnyElementAttributes
To be added: an object of type 'XmlAnyElementAttributes'
The can be applied to a member that returns an array of objects on deserialization. This allows the to deserialize any elements that do not have a corresponding member in the object being deserialized--thus those elements are "unknown" to the . This is useful when the XML stream has been altered by an XML Web service, or when it is known that random data is always included with the XML stream.
The property allows you to override the serialization of a member to function as a member to which the has been applied.
Gets the collection of objects to override.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Xml.Serialization.XmlArrayAttribute
To be added: an object of type 'XmlArrayAttribute'
There are two ways in which a public field or public read/write property that returns an array is serialized by the : the default serialization, and the controlled serialization.
In the default serialization, no attribute is applied to the member. When serialized, the array is serialized as a nested sequence of XML elements with the XML element name of the nested sequence taken from the member name.
To control the serialization more precisely, apply an to the field or property. For example, you can change the generated XML element name from the default to a different name by setting the property to a new value.
The property allows you to override the default serialization, as well as the serialization controlled by applying an to the member. For example, you can change the XML element name generated from the default (the member identifier) to a new value. In addition, if you apply an to a member, it is overridden by any that is assigned to the property.
Gets or sets an object that specifies how the serializes a public field or read/write property that returns an array.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Xml.Serialization.XmlArrayItemAttributes
To be added: an object of type 'XmlArrayItemAttributes'
The property allows you to specify the derived types that can be inserted into an array returned by a public field or public read/write property. For each new type you want the field or property to accept, create an object and it to the ) returned by the property. (The new type must be derived from the type already accepted by the field or property.) the object to an object and specify the type of the object that contains the field or property, and the name of the field or property. Construct an with the object before calling or method.
Gets or sets a collection of objects that specify how the serializes items inserted into an array returned by a public field or read/write property.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Xml.Serialization.XmlAttributeAttribute
To be added: an object of type 'XmlAttributeAttribute'
By default, if no attribute is applied to a public field or public read/write property, it is serialized as an XML element. You can also instruct the to generate an XML attribute by applying an to the field or property.
The property allows you to override the default serialization, as well as the serialization controlled by applying an to the member. To do this, create an and set its properties (such as ). Assign the new object to the property of an object. Add the object to an object and specify the type of the object that contains the field or property, and the name of the field or property. Lastly, create an using the object and call the or method.
Gets or sets an object that specifies how the serializes a public field or public read/write property as an XML attribute.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Xml.Serialization.XmlChoiceIdentifierAttribute
To be added: an object of type 'XmlChoiceIdentifierAttribute'
To be added
Gets or sets an object that allows you to distinguish between a set of choices.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Object
To be added: an object of type 'object'
You can specify the default value of an XML element or XML attribute by applying a to a member. To examine the result of applying the value, compile the application into a DLL or executable, and pass the resulting file as an argument to the XML Schema Definition tool (XSD.exe). In the XML schema document, a default value is assigned to the default attribute. In the following example, the default for the <Animal> element is "Dogs."
<?xml version="1.0"?>
<schema attributeFormDefault="qualified"
elementFormDefault="qualified" targetNamespace=""
xmlns="http://www.w3.org/2000/10/XMLSchema">
<element name="Pets" nullable="true" type="Pets"/>
<complexType name="Pets">
<sequence>
<element default="Dogs" name="Animal" nullable="true"
type="string" minOccurs="0"/>
</sequence>
</complexType>
</schema>
To override the default value, create an and assign it to the .
If the value assigned to a field or property is equal to the default value for that field or property, the does not serialize the value to the XML-instance. This is because the assigned value can be recovered from the XML schema. In other words, setting a field or property to its own default value is equivalent of not setting it at all. Likewise, if no value is set for the field or property, the uses the default value found in the schema. In both cases, (setting the property to its default, or not setting it at all), the XML-document instance does not contain any value for the property.
You can use the class constructors instead of the schema to assign the default values. If you are using Xsd.exe to generate a classes from schemas, you can comment out or remove all of the [System.ComponentModel.DefaultValueAttribute("myFieldName")] attributes from the class files.
Gets or sets the default value of an XML element or attribute.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Xml.Serialization.XmlElementAttributes
To be added: an object of type 'XmlElementAttributes'
For each overridden member that is serialized as an XML element, you must add a new to an by calling the method. By default, an object is created and assigned to the property.
Gets a collection of objects that specify how the serializes a public field or read/write property as an XML element.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Xml.Serialization.XmlEnumAttribute
To be added: an object of type 'XmlEnumAttribute'
For each identifier you want to override, you must create an object, and set the property to an that overrides the identifier. Add the object to the object and specify both the of the class that contains the enumeration, and the overridden member name.
Gets or sets an object that specifies how the serializes an enumeration member.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Boolean
To be added: an object of type 'bool'
By default, all public fields and public read/write properties are serialized by the . That is, the value of each public field or property is persisted as an XML element or XML attribute in an XML-document instance.
To override the default serialization of a field or property, create an object, and set its property to true. the object to an object and specify the type of the object that contains the field or property to ignore, and the name of the field or property to ignore.
If an is applied to a field or property, the field or property is ignored. However you can override that behavior by creating an object, setting its property to false, adding it to an object specifying the type of the object that contains the field or property, and the name of the field or property.
Gets or sets a value that specifies whether or not the serializes a public field or public read/write property.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Boolean
To be added: an object of type 'bool'
To be added
Gets or sets a value that specifies whether to keep all namespace declarations when an object containing a member that returns an object is overridden.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Xml.Serialization.XmlRootAttribute
To be added: an object of type 'XmlRootAttribute'
To be added
Gets or sets an object that specifies how the serializes a class as an XML root element.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Xml.Serialization.XmlTextAttribute
To be added: an object of type 'XmlTextAttribute'
By default, a public field or public read/write property is serialized as an XML element by the . However, it can force the field or property to be serialized as XML text by applying an to the field or property.
The cannot be applied to a field or property that returns an array.
To override the default serialization of a field or property (that does not return an array), create an and assign it to the property of an object. Add the object to an object and specify the type of the object that contains the overridden field or property, and the name of the overridden field or property.
Gets or sets an object that instructs the to serialize a public field or public read/write property as XML text.
Property
1.0.5000.0
2.0.0.0
4.0.0.0
System.Xml.Serialization.XmlTypeAttribute
To be added: an object of type 'XmlTypeAttribute'
The can be used to control how a type is serialized by the . For example, by default, when a type is serialized, the uses the class name as the XML element name. By creating an , setting the property to it, and creating an object, you can change the XML element name.
Gets or sets an object that specifies how the serializes a class to which the has been applied.