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.
Assembly: System.Xml (in System.Xml.dll)
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 XmlArrayItemAttribute object and Add it to the XmlArrayItemAttributes) returned by the 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.
The following example serializes a class that contains a field named Members that returns an array of objects. Two XmlArrayItemAttribute objects are created to allow the field to accept objects that derive from the base class named Member. Each object is added to the XmlAttributes through the property.
.NET FrameworkSupported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0
.NET Framework Client ProfileSupported in: 4, 3.5 SP1
Portable Class LibrarySupported in: Portable Class Library
.NET for Windows Store appsSupported in: Windows 8
.NET for Windows Phone appsSupported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.