mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 11:21:39 -10:00
* CodeIdentifiers.cs: * XmlSchemaExporter.cs: * XmlSchemaImporter.cs: * XmlSchemas.cs: * XmlSerializationWriteCallback.cs: * XmlSerializationWriter.cs: * XmlSerializer.cs: * XmlSerializerNamespaces.cs: some class status based fixed and implemented a couple of methods. svn path=/trunk/mcs/; revision=7442
77 lines
1.5 KiB
C#
77 lines
1.5 KiB
C#
//
|
|
// XmlSerializerNamespaces.cs:
|
|
//
|
|
// Author:
|
|
// John Donagher ([email protected])
|
|
//
|
|
// (C) 2002 John Donagher
|
|
//
|
|
|
|
using System;
|
|
using System.Xml;
|
|
using System.Collections;
|
|
|
|
namespace System.Xml.Serialization
|
|
{
|
|
/// <summary>
|
|
/// Summary description for XmlSerializerNamespaces.
|
|
/// </summary>
|
|
public class XmlSerializerNamespaces
|
|
{
|
|
private Hashtable namespaces;
|
|
|
|
public XmlSerializerNamespaces ()
|
|
{
|
|
namespaces = new Hashtable ();
|
|
}
|
|
|
|
public XmlSerializerNamespaces(XmlQualifiedName[] namespaces)
|
|
: this()
|
|
{
|
|
foreach(XmlQualifiedName qname in namespaces)
|
|
{
|
|
this.namespaces[qname.Name] = qname;
|
|
}
|
|
}
|
|
|
|
public XmlSerializerNamespaces(XmlSerializerNamespaces namespaces)
|
|
: this(namespaces.ToArray())
|
|
{}
|
|
|
|
public void Add (string prefix, string ns)
|
|
{
|
|
XmlQualifiedName qname = new XmlQualifiedName(prefix,ns);
|
|
namespaces[qname.Name] = qname;
|
|
}
|
|
|
|
public XmlQualifiedName[] ToArray ()
|
|
{
|
|
XmlQualifiedName[] array = new XmlQualifiedName[namespaces.Count];
|
|
namespaces.Values.CopyTo(array,0);
|
|
return array;
|
|
}
|
|
|
|
public int Count
|
|
{
|
|
get{ return namespaces.Count; }
|
|
}
|
|
|
|
internal string GetPrefix(string Ns)
|
|
{
|
|
foreach(string prefix in namespaces.Keys)
|
|
{
|
|
if(Ns == ((XmlQualifiedName)namespaces[prefix]).Namespace)
|
|
return prefix;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
internal Hashtable Namespaces
|
|
{
|
|
get {
|
|
return namespaces;
|
|
}
|
|
}
|
|
}
|
|
}
|