615 lines
24 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<Type Name="XmlRootAttribute" FullName="System.Xml.Serialization.XmlRootAttribute">
<TypeSignature Maintainer="auto" Language="C#" Value="public class XmlRootAttribute : Attribute" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit XmlRootAttribute 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.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.ReturnValue | System.AttributeTargets.All)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="T:System.Xml.Serialization.XmlRootAttribute" /> 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.XmlRootAttribute" /> to a class, structure, enumeration, or interface. You can also apply the attribute to the return value of an XML Web service method.</para>
<para>Every XML document must have a single root element that contains all the other elements. The <see cref="T:System.Xml.Serialization.XmlRootAttribute" /> allows you to control how the <see cref="T:System.Xml.Serialization.XmlSerializer" /> generates the root element by setting certain properties. For example, specify the name of the generated XML element by setting the <see cref="P:System.Xml.Serialization.XmlRootAttribute.ElementName" /> property.</para>
<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 XmlRoot in your code instead of the longer <see cref="T:System.Xml.Serialization.XmlRootAttribute" />.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Controls XML serialization of the attribute target as an XML root element.</para>
</summary>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public XmlRootAttribute ();" />
<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.XmlRootAttribute" /> class.</para>
</summary>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public XmlRootAttribute (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>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.XmlRootAttribute" /> class and specifies the name of the XML root element.</para>
</summary>
<param name="elementName">
<attribution license="cc4" from="Microsoft" modified="false" />The name of the XML root element. </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 XSD simple data types with their .NET equivalents.</para>
<para>For the XSD base64Binary and hexBinary data types, use an array of <see cref="T:System.Byte" /> structures, and apply a <see cref="T:System.Xml.Serialization.XmlRootAttribute" /> with the <see cref="P:System.Xml.Serialization.XmlRootAttribute.DataType" /> property set to "base64Binary" or "hexBinary", as appropriate. For the XSD time and date data types, use the <see cref="T:System.DateTime" /> type and apply the <see cref="T:System.Xml.Serialization.XmlRootAttribute" /> with the <see cref="P:System.Xml.Serialization.XmlRootAttribute.DataType" /> set to "date" or "time".</para>
<para>For every XSD type that is mapped to a string, apply the <see cref="T:System.Xml.Serialization.XmlRootAttribute" /> with its <see cref="P:System.Xml.Serialization.XmlRootAttribute.DataType" /> property set to the XSD 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 XSD data types.</para>
</block>
<block subset="none" type="note">
<para>Passing binary data as an XML element is more efficient than passing it as an XML attribute.</para>
</block>
<para>For more information about XML data types, see the World Wide Web Consortium (www.w3.org) document named "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>recurringDate </para>
</term>
<description>
<para>
<see cref="T:System.String" /> </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 XSD data type of the XML root 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 class name.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the name of the XML element that is generated and recognized by the <see cref="T:System.Xml.Serialization.XmlSerializer" /> class's <see cref="M:System.Xml.Serialization.XmlSerializer.Serialize(System.IO.TextWriter,System.Object)" /> and <see cref="M:System.Xml.Serialization.XmlSerializer.Deserialize(System.IO.Stream)" /> methods, respectively.</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 http://www.w3.org/TR/xmlschema-1/ specification named <paramref name="XML Schema Part 1: Structures" />.</para>
<para>If the <see cref="P:System.Xml.Serialization.XmlRootAttribute.IsNullable" /> property is set to true, the xsi:nil attribute is generated as shown in the following XML: </para>
<code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;Group xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:nil="true" /&gt;</code>
<para>If the <see cref="P:System.Xml.Serialization.XmlRootAttribute.IsNullable" /> property is false, an empty element is created as shown in the following code: </para>
<code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;Group xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" /&gt;</code>
</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 that is set to null into 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 named <paramref name="Namespaces in XML" />.</para>
<para>To create prefixed namespaces in the XML document, create an <see cref="T:System.Xml.Serialization.XmlSerializerNamespaces" /> object that contains all the prefix-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" /> object. 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 for the XML root element.</para>
</summary>
</Docs>
</Member>
</Members>
</Type>