XmlArrayItemAttribute.NestingLevel Property

May 11, 2014

Gets or sets the level in a hierarchy of XML elements that the XmlArrayItemAttribute affects.

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

public int NestingLevel { get; set; }

Property Value

Type: System.Int32
The zero-based index of a set of indexes in an array of arrays.

An XML document can contain hierarchies of XML elements. To represent such a hierarchy, an array of arrays is used. In such an array, each index represents a level in the hierarchy. Therefore, the NestingLevel property is used only when applying an XmlArrayItemAttribute to a field that returns an array of arrays.

When applying the attribute, specify which hierarchy level the attribute affects by setting the NestingLevel. The first index always has the value of 0; therefore, it is optional to set its NestingLevel. An XmlArrayItemAttribute without a NestingLevel value is applied to the first array index. Only the subsequent XmlArrayItemAttribute objects require NestingLevel values specified (as 1, 2, 3, and so forth).

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft