Freigeben über


XmlSerializerNamespaces-Konstruktor (XmlSerializerNamespaces)

Dieser Konstruktor unterstützt die .NET Framework-Infrastruktur und ist nicht für die direkte Verwendung in Code bestimmt.

Initialisiert eine neue Instanz der XmlSerializerNamespaces-Klasse unter Verwendung der angegebenen Instanz von XmlSerializerNamespaces mit einer Auflistung von Paaren aus Präfix und Namespace.

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

Syntax

'Declaration
Public Sub New ( _
    namespaces As XmlSerializerNamespaces _
)
'Usage
Dim namespaces As XmlSerializerNamespaces

Dim instance As New XmlSerializerNamespaces(namespaces)
public XmlSerializerNamespaces (
    XmlSerializerNamespaces namespaces
)
public:
XmlSerializerNamespaces (
    XmlSerializerNamespaces^ namespaces
)
public XmlSerializerNamespaces (
    XmlSerializerNamespaces namespaces
)
public function XmlSerializerNamespaces (
    namespaces : XmlSerializerNamespaces
)

Parameter

Beispiel

Im folgenden Beispiel werden zwei XmlQualifiedName-Objekte und aus diesen eine neue XmlSerializerNamespaces-Instanz erstellt.

Private Function CreateFromQNames() As XmlSerializerNamespaces
    Dim q1 As New XmlQualifiedName("money", "http://www.cohowinery.com")
    Dim q2 As New XmlQualifiedName("books", "http://www.cpandl.com")
    
    Dim names() As XmlQualifiedName =  {q1, q2}
    
    Return New XmlSerializerNamespaces(names)
End Function
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);
}
private:
   XmlSerializerNamespaces^ CreateFromQNames()
   {
      XmlQualifiedName^ q1 =
         gcnew XmlQualifiedName( "money","http://www.cohowinery.com" );

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

      array<XmlQualifiedName^>^ names = { q1, q2 };

      return gcnew XmlSerializerNamespaces( names );
   }
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);
} //CreateFromQNames

Plattformen

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

.NET Compact Framework

Unterstützt in: 2.0, 1.0

Siehe auch

Referenz

XmlSerializerNamespaces-Klasse
XmlSerializerNamespaces-Member
System.Xml.Serialization-Namespace