System.Xml.Serialization.XmlAttributeOverrides.Add Method

Adds an System.Xml.Serialization.XmlAttributes object to the collection of System.Xml.Serialization.XmlAttributes objects. The type parameter specifies an object to be overridden by the System.Xml.Serialization.XmlAttributes object.

Syntax

public void Add (Type type, XmlAttributes attributes)

Parameters

type
The Type of the object that is overridden.
attributes
An System.Xml.Serialization.XmlAttributes object that represents the overriding attributes.

Remarks

The System.Xml.Serialization.XmlAttributes object contains a union of attribute objects that cause the System.Xml.Serialization.XmlSerializer to override its default serialization behavior for a set of objects. You choose the attribute objects to place in the System.Xml.Serialization.XmlAttributes object, depending on the particular behaviors you want to override. For example, the System.Xml.Serialization.XmlSerializer serializes a class member as an XML element by default. If you want the member to be serialized as an XM attribute instead, you would create an System.Xml.Serialization.XmlAttributeAttribute, assign it to the XmlAttributes.XmlAttribute property of an System.Xml.Serialization.XmlAttributes, and add the System.Xml.Serialization.XmlAttributes object to the System.Xml.Serialization.XmlAttributeOverrides object.

Use this overload to override an System.Xml.Serialization.XmlRootAttribute or System.Xml.Serialization.XmlTypeAttribute.

Requirements

Namespace: System.Xml.Serialization
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0