System.Xml.Serialization.SoapAttributeOverrides.Add Method

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

Syntax

public void Add (Type type, SoapAttributes attributes)

Parameters

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

Remarks

The System.Xml.Serialization.SoapAttributes 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.SoapAttributes, 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 XML attribute instead, you would create a System.Xml.Serialization.SoapAttributeAttribute, assign it to the SoapAttributes.SoapAttribute property of a System.Xml.Serialization.SoapAttributes, and add the System.Xml.Serialization.XmlAttributes to the System.Xml.Serialization.SoapAttributeOverrides. Use the SoapAttributeOverrides.Add(Type, SoapAttributes) method to add the System.Xml.Serialization.SoapAttributes to the System.Xml.Serialization.SoapAttributeOverrides.

Use this overload to add a System.Xml.Serialization.SoapAttributes that contains a System.Xml.Serialization.SoapTypeAttribute. Because the System.Xml.Serialization.SoapTypeAttribute overrides the serialization of a class, you need not specify a member of the class to override, only the type of the class.

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