XmlSerializerNamespaces.ToArray Method ()

 

Gets the array of prefix and namespace pairs in an XmlSerializerNamespaces object.

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

public XmlQualifiedName[] ToArray()

Return Value

Type: System.Xml.XmlQualifiedName[]

An array of XmlQualifiedName objects that are used as qualified names in an XML document.

The following example prints each Name and Namespace in an XmlSerializerNamespaces object.

private void PrintNamespacePairs(XmlSerializerNamespaces namespaces)
{
   XmlQualifiedName[] qualifiedNames = namespaces.ToArray();
   for(int i = 0; i < qualifiedNames.Length; i++)
   {
      Console.WriteLine
      (
      qualifiedNames[i].Name + "\t" +
      qualifiedNames[i].Namespace
      );
   }
}

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: