Udostępnij za pośrednictwem


XmlAttributes.XmlArrayItems Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets a collection of objects that specify how the XmlSerializer serializes items inserted into an array returned by a public field or read/write property.

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

Syntax

'Declaration
Public ReadOnly Property XmlArrayItems As XmlArrayItemAttributes
public XmlArrayItemAttributes XmlArrayItems { get; }

Property Value

Type: System.Xml.Serialization.XmlArrayItemAttributes
An XmlArrayItemAttributes object that contains a collection of XmlArrayItemAttribute objects.

Remarks

The XmlArrayItems 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 XmlArrayItemAttribute object and Add it to the XmlArrayItemAttributes returned by the XmlArrayItems property. (The new type must be derived from the type already accepted by the field or property.) Add the XmlAttributes object to an XmlAttributeOverrides object and specify the type of the object that contains the field or property, and the name of the field or property. Construct an XmlSerializer with the XmlAttributeOverrides object before calling Serialize or Deserialize method.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.