Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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:
array<XmlQualifiedName^>^ ToArray()

Return Value

Type: array<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 )
   {
      array<XmlQualifiedName^>^ qualifiedNames = namespaces->ToArray();
      for ( int i = 0; i < qualifiedNames->Length; i++ )
      {
         Console::WriteLine( "{0}\t{1}",
            qualifiedNames[ i ]->Name, 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:
© 2017 Microsoft