XmlSerializerNamespaces Constructor (XmlSerializerNamespaces)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

This API supports the product infrastructure and is not intended to be used directly from your code.

Initializes a new instance of the XmlSerializerNamespaces class, using the specified instance of XmlSerializerNamespaces containing the collection of prefix and namespace pairs.

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

public XmlSerializerNamespaces(
	XmlSerializerNamespaces namespaces
)

Parameters

namespaces
Type: System.Xml.Serialization.XmlSerializerNamespaces

An instance of the XmlSerializerNamespacescontaining the namespace and prefix pairs.

The following example creates two XmlQualifiedName objects, and creates a new XmlSerializerNamespaces instance from them.

private XmlSerializerNamespaces CreateFromQNames()
{
   XmlQualifiedName q1 = 
   new XmlQualifiedName("money", "http://www.cohowinery.com");

   XmlQualifiedName q2 = 
   new XmlQualifiedName("books", "http://www.cpandl.com");

   XmlQualifiedName[] names = {q1, q2};

   return new XmlSerializerNamespaces(names);
}

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: