Add Method (Type, String, XmlAttributes)
Collapse the table of content
Expand the table of content

XmlAttributeOverrides.Add Method (Type, String, XmlAttributes)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Adds an XmlAttributes object to the collection of XmlAttributes objects. The type parameter specifies an object to be overridden. The member parameter specifies the name of a member that is overridden.

Namespace:  System.Xml.Serialization
Assembly:  System.Xml.Serialization (in System.Xml.Serialization.dll)

'Declaration
Public Sub Add ( _
	type As Type, _
	member As String, _
	attributes As XmlAttributes _
)

Parameters

type
Type: System.Type
The Type of the object to override.
member
Type: System.String
The name of the member to override.
attributes
Type: System.Xml.Serialization.XmlAttributes
An XmlAttributes object that represents the overriding attributes.

ExceptionCondition
InvalidOperationException

More than one XmlAttributes object was added for a member of some type.

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

Use this method when attempting to override an XmlElementAttribute, XmlAttributeAttribute, XmlArrayAttribute, XmlArrayItemAttribute, or XmlIgnoreAttribute.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft