Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

797 lines
37 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Type Name="XmlArrayItemAttribute" FullName="System.Xml.Serialization.XmlArrayItemAttribute">
<TypeSignature Maintainer="auto" Language="C#" Value="public class XmlArrayItemAttribute : Attribute" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit XmlArrayItemAttribute extends System.Attribute" />
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ThreadSafetyStatement>To be added</ThreadSafetyStatement>
<Base>
<BaseTypeName>System.Attribute</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName>System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.ReturnValue | System.AttributeTargets.All, AllowMultiple=true)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" /> belongs to a family of attributes that controls how the <see cref="T:System.Xml.Serialization.XmlSerializer" /> serializes or deserializes an object. For a complete list of similar attributes, see <format type="text/html"><a href="414b820f-a696-4206-b576-2711d85490c7">Attributes That Control XML Serialization</a></format>.</para>
<para>You can apply the <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" /> to any public read/write member that returns an array, or provides access to one. For example, a field that returns an array of objects, a collection, an <see cref="T:System.Collections.ArrayList" />, or any class that implements the <see cref="T:System.Collections.IEnumerable" /> interface.</para>
<para>The <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" /> supports polymorphism--in other words, it allows the <see cref="T:System.Xml.Serialization.XmlSerializer" /> to add derived objects to an array. For example, suppose a class named Mammal is derived from a base class named Animal. Further suppose that a class named MyAnimals contains a field that returns an array of Animal objects. To allow the <see cref="T:System.Xml.Serialization.XmlSerializer" /> to serialize both the Animal and Mammal type, apply the <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" /> to the field twice, each time specifying one of the two acceptable types.</para>
<block subset="none" type="note">
<para>You can apply multiple instances of the <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" /> or <see cref="T:System.Xml.Serialization.XmlElementAttribute" /> to specify types of objects that can be inserted into the array.</para>
</block>
<block subset="none" type="note">
<para>The serialization of a field or property that returns an interface or array of interfaces is not supported.</para>
</block>
<para>For more information about using attributes, see <format type="text/html"><a href="30386922-1e00-4602-9ebf-526b271a8b87">Extending Metadata Using Attributes</a></format>.</para>
<block subset="none" type="note">
<para>You can use the word XmlArrayItem in your code instead of the longer <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" />.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Represents an attribute that specifies the derived types that the <see cref="T:System.Xml.Serialization.XmlSerializer" /> can place in a serialized array.</para>
</summary>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public XmlArrayItemAttribute ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue />
<Parameters />
<Docs>
<remarks>To be added</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" /> class.</para>
</summary>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public XmlArrayItemAttribute (string elementName);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string elementName) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue />
<Parameters>
<Parameter Name="elementName" Type="System.String" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This overload sets the <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.ElementName" /> property.</para>
<para>Use this overload if you want the name of the generated XML element to differ from the member's identifier.</para>
<para>An XML document that includes namespaces can contain more than one version of an element name. For details, see the <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.ElementName" /> property.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" /> class and specifies the name of the XML element generated in the XML document.</para>
</summary>
<param name="elementName">
<attribution license="cc4" from="Microsoft" modified="false" />The name of the XML element. </param>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public XmlArrayItemAttribute (Type type);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Type type) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue />
<Parameters>
<Parameter Name="type" Type="System.Type" />
</Parameters>
<Docs>
<remarks>To be added</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" /> class and specifies the <see cref="T:System.Type" /> that can be inserted into the serialized array.</para>
</summary>
<param name="type">
<attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Type" /> of the object to serialize. </param>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public XmlArrayItemAttribute (string elementName, Type type);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string elementName, class System.Type type) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue />
<Parameters>
<Parameter Name="elementName" Type="System.String" />
<Parameter Name="type" Type="System.Type" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This overload sets the <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.ElementName" /> and the <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.Type" /> properties.</para>
<para>Use this overload if you want the name of the generated XML element to differ from the member's identifier.</para>
<para>An XML document that includes namespaces can contain more than one version of an element name. For details, see the <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.ElementName" /> property.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" /> class and specifies the name of the XML element generated in the XML document and the <see cref="T:System.Type" /> that can be inserted into the generated XML document.</para>
</summary>
<param name="elementName">
<attribution license="cc4" from="Microsoft" modified="false" />The name of the XML element. </param>
<param name="type">
<attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Type" /> of the object to serialize. </param>
</Docs>
</Member>
<Member MemberName="DataType">
<MemberSignature Language="C#" Value="public string DataType { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string DataType" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<value>To be added: an object of type 'string'</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The following table lists the XML Schema simple data types with their .NET equivalents.</para>
<para>For the XML Schema base64Binary and hexBinary data types, use an array of <see cref="T:System.Byte" /> objects, and apply an <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" /> with the <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.DataType" /> property set to "base64Binary" or "hexBinary", as appropriate. For the XML Schema time and date data types, use the <see cref="T:System.DateTime" /> type and apply the <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" /> with the <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.DataType" /> set to "date" or "time".</para>
<para>For every XML Schema type that is mapped to a string, apply the <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" /> with its <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.DataType" /> property set to the XML Schema type. However, this does not change the serialization format, only the schema for the member.</para>
<block subset="none" type="note">
<para>The property is case-sensitive, so you must set it exactly to one of the XML Schema data types.</para>
</block>
<block subset="none" type="note">
<para>Passing binary data as an XML element is more efficient then passing it as an XML attribute.</para>
</block>
<para>For more information about XML Schema data types, see the World Wide Web Consortium (www.w3.org) document "XML Schema Part 2: Datatypes." </para>
<list type="table">
<listheader>
<item>
<term>
<para>XSD data type </para>
</term>
<description>
<para>.NET data type </para>
</description>
</item>
</listheader>
<item>
<term>
<para>anyURI </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>base64Binary </para>
</term>
<description>
<para>Array of <see cref="T:System.Byte" /> objects </para>
</description>
</item>
<item>
<term>
<para>boolean </para>
</term>
<description>
<para>
<see cref="T:System.Boolean" /> </para>
</description>
</item>
<item>
<term>
<para>byte </para>
</term>
<description>
<para>
<see cref="T:System.SByte" /> </para>
</description>
</item>
<item>
<term>
<para>date </para>
</term>
<description>
<para>
<see cref="T:System.DateTime" /> </para>
</description>
</item>
<item>
<term>
<para>dateTime </para>
</term>
<description>
<para>
<see cref="T:System.DateTime" /> </para>
</description>
</item>
<item>
<term>
<para>decimal </para>
</term>
<description>
<para>
<see cref="T:System.Decimal" /> </para>
</description>
</item>
<item>
<term>
<para>double </para>
</term>
<description>
<para>
<see cref="T:System.Double" /> </para>
</description>
</item>
<item>
<term>
<para>ENTITY </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>ENTITIES </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>float </para>
</term>
<description>
<para>
<see cref="T:System.Single" /> </para>
</description>
</item>
<item>
<term>
<para>gDay </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>gMonth </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>gMonthDay </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>gYear </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>gYearMonth </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>hexBinary </para>
</term>
<description>
<para>Array of <see cref="T:System.Byte" /> objects </para>
</description>
</item>
<item>
<term>
<para>ID </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>IDREF </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>IDREFS </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>int </para>
</term>
<description>
<para>
<see cref="T:System.Int32" /> </para>
</description>
</item>
<item>
<term>
<para>integer </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>language </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>long </para>
</term>
<description>
<para>
<see cref="T:System.Int64" /> </para>
</description>
</item>
<item>
<term>
<para>Name </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>NCName </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>negativeInteger </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>NMTOKEN </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>NMTOKENS </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>normalizedString </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>nonNegativeInteger </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>nonPositiveInteger </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>NOTATION </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>positiveInteger </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>QName </para>
</term>
<description>
<para>
<see cref="T:System.Xml.XmlQualifiedName" /> </para>
</description>
</item>
<item>
<term>
<para>duration </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>string </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>short </para>
</term>
<description>
<para>
<see cref="T:System.Int16" /> </para>
</description>
</item>
<item>
<term>
<para>time </para>
</term>
<description>
<para>
<see cref="T:System.DateTime" /> </para>
</description>
</item>
<item>
<term>
<para>token </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </para>
</description>
</item>
<item>
<term>
<para>unsignedByte </para>
</term>
<description>
<para>
<see cref="T:System.Byte" /> </para>
</description>
</item>
<item>
<term>
<para>unsignedInt </para>
</term>
<description>
<para>
<see cref="T:System.UInt32" /> </para>
</description>
</item>
<item>
<term>
<para>unsignedLong </para>
</term>
<description>
<para>
<see cref="T:System.UInt64" /> </para>
</description>
</item>
<item>
<term>
<para>unsignedShort </para>
</term>
<description>
<para>
<see cref="T:System.UInt16" /> </para>
</description>
</item>
</list>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the XML data type of the generated XML element.</para>
</summary>
</Docs>
</Member>
<Member MemberName="ElementName">
<MemberSignature Language="C#" Value="public string ElementName { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ElementName" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<value>To be added: an object of type 'string'</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Specify an <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.ElementName" /> if you want the name of the generated XML element to differ from the member's identifier.</para>
<para>You can set the same <see cref="P:System.Xml.Serialization.XmlArrayAttribute.ElementName" /> value to more than one class member if the generated XML document uses XML namespaces to distinguish between identically named members. For details about how to use namespaces and prefixed names in the XML document, see the <see cref="T:System.Xml.Serialization.XmlSerializerNamespaces" /> class.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the name of the generated XML element.</para>
</summary>
</Docs>
</Member>
<Member MemberName="Form">
<MemberSignature Language="C#" Value="public System.Xml.Schema.XmlSchemaForm Form { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Xml.Schema.XmlSchemaForm Form" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Xml.Schema.XmlSchemaForm</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<value>To be added: an object of type 'System.Xml.Schema.XmlSchemaForm'</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="P:System.Xml.Serialization.XmlAttributeAttribute.Form" /> property determines whether an XML element name is qualified, based on the World Wide Web Consortium (www.w3.org) specification "Namespaces in XML." </para>
<para>If the <see cref="P:System.Xml.Serialization.XmlAttributeAttribute.Namespace" /> property is set to any value, attempting to set the <see cref="P:System.Xml.Serialization.XmlElementAttribute.Form" /> property to XmlSchemaForm.Unqualified throws an exception.</para>
<para>The default value, XmlSchemaForm.None, instructs the <see cref="T:System.Xml.Serialization.XmlSerializer" /> to check the schema for the XML document to determine whether the namespace is qualified. For elements, the <see cref="T:System.Xml.Serialization.XmlSerializer" /> checks the value of the schema-element attribute elementFormDefault. For attributes, it checks the value of the schema-element attribute attributeFormDefault. For example, the following XML Schema indicates that the Name element is qualified, while the Number element is unqualified.</para>
<code> &lt;schema elementFormDefault="qualified"
attributeFormDefault="unqualified"&gt;
&lt;element name="Name"/&gt;
&lt;attribute name="Number"/&gt;
&lt;/schema&gt;</code>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets a value that indicates whether the name of the generated XML element is qualified.</para>
</summary>
</Docs>
</Member>
<Member MemberName="IsNullable">
<MemberSignature Language="C#" Value="public bool IsNullable { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsNullable" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<value>To be added: an object of type 'bool'</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The XML schema specification for structures allows an XML document to explicitly signal that an element's content is missing. Such an element contains the attribute xsi:nil set to true. For more information, see the World Wide Web Consortium (www.w3.org) specification titled "XML Schema Part 1: Structures." </para>
<para>If the <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.IsNullable" /> property is true, the xsi:nil attribute is generated for class members that have been set to null. For example, if you set a field named MyStringArray to null, the <see cref="T:System.Xml.Serialization.XmlSerializer" /> generates the following XML code.</para>
<code> &lt;MyStringArray xsi:nil = "true" /&gt;</code>
<para>If the <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.IsNullable" /> property is false, no XML element is generated.</para>
<block subset="none" type="note">
<para>You cannot apply the <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.IsNullable" /> property to a member typed as a value type because a value type cannot contain null.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets a value that indicates whether the <see cref="T:System.Xml.Serialization.XmlSerializer" /> must serialize a member as an empty XML tag with the xsi:nil attribute set to true.</para>
</summary>
</Docs>
</Member>
<Member MemberName="Namespace">
<MemberSignature Language="C#" Value="public string Namespace { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Namespace" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<value>To be added: an object of type 'string'</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.Namespace" /> property conforms to the World Wide Web Consortium (www.w3.org) specification "Namespaces in XML." </para>
<para>To create namespaces to use in the XML document and associated prefixes, you must create an <see cref="T:System.Xml.Serialization.XmlSerializerNamespaces" /> that contains all the prefix and namespace pairs. The namespace you set for each <see cref="T:System.Xml.Serialization.XmlArrayAttribute" /> must be contained in the <see cref="T:System.Xml.Serialization.XmlSerializerNamespaces" />. When the <see cref="T:System.Xml.Serialization.XmlSerializer" /> generates the document, it correctly prefixes the element name for each array item.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the namespace of the generated XML element.</para>
</summary>
</Docs>
</Member>
<Member MemberName="NestingLevel">
<MemberSignature Language="C#" Value="public int NestingLevel { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 NestingLevel" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<value>To be added: an object of type 'int'</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>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 <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.NestingLevel" /> property is only used when applying an <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" /> to a field that returns an array of arrays.</para>
<para>When applying the attribute, specify which hierarchy level the attribute affects by setting the <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.NestingLevel" />. The first index always has the value of 0; therefore it is optional to set its <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.NestingLevel" /> --an <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" /> without a <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.NestingLevel" /> value is applied to the first array index. Only the subsequent <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" /> objects require <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.NestingLevel" /> values specified (as 1, 2, 3, and so forth).</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the level in a hierarchy of XML elements that the <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" /> affects.</para>
</summary>
</Docs>
</Member>
<Member MemberName="Type">
<MemberSignature Language="C#" Value="public Type Type { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Type Type" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Type</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<value>To be added: an object of type 'System.Type'</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Use the <see cref="P:System.Xml.Serialization.XmlElementAttribute.Type" /> property to specify an overridden type for a public field or public read/write property value.</para>
<para>If a field or property returns an array of type <see cref="T:System.Object" />, apply multiple instances of the <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" /> to the field or property. For each instance, set the <see cref="P:System.Xml.Serialization.XmlElementAttribute.Type" /> property to a type of object that can be inserted into the array.</para>
<para>If an array contains only primitive types, you do not need to apply the <see cref="T:System.Xml.Serialization.XmlArrayItemAttribute" />. By default, the <see cref="T:System.Xml.Serialization.XmlSerializer" /> generates a series of elements, each with the same element name, for each value, but the type of each element is set to the XML Schema data type. For example, the following code: </para>
<code> ' Visual Basic code
Public Class Arrays
Public XSDTypes ()As Object= New Object(){"one", 2, 3.0}
End Class
// C# code
public class MyArray{
// No XmlArrayItemAttribute is applied.
public object[] XSDTypes= new object[]{"one", 2, 3.2};
}</code>
<para>results in this XML: </para>
<code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;Arrays xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;XSDTypes&gt;
&lt;Object xsi:type="xsd:string"&gt;one&lt;/Object&gt;
&lt;Object xsi:type="xsd:int"&gt;2&lt;/Object&gt;
&lt;Object xsi:type="xsd:double"&gt;3&lt;/Object&gt;
&lt;/XSDTypes&gt;
&lt;/Arrays&gt;</code>
<para>However, if you specify the <see cref="P:System.Xml.Serialization.XmlArrayItemAttribute.Type" /> property for each primitive type, the element name for each value is generated using the .NET type name. For example this code: </para>
<code> ' Visual Basic code
Public Class Arrays
&lt;XmlArrayItem(GetType(String)), _
XmlArrayItem(GetType(Integer)), _
XmlArrayItem(GetType(Double))&gt; _
Public PrimitiveTypes () As Object = New Object(){"one", 2, 3.0}
End Class
// C# code
public class Arrays{
[XmlArrayItem(typeof(string))]
[XmlArrayItem(typeof(int))]
[XmlArrayItem(typeof(double))]
public object [] PrimitiveTypes = new object[]{"one", 2, 3.0};
}</code>
<para>results in this XML: </para>
<code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;Arrays xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;PrimitiveTypes&gt;
&lt;string&gt;one&lt;/string&gt;
&lt;int&gt;2&lt;/int&gt;
&lt;double&gt;3&lt;/double&gt;
&lt;/PrimitiveTypes&gt;
&lt;/Arrays&gt;</code>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the type allowed in an array.</para>
</summary>
</Docs>
</Member>
</Members>
</Type>