public static XmlName Create(string prefix, string localName, string ns, int hashCode, XmlDocument ownerDoc, XmlName next, IXmlSchemaInfo schemaInfo) { if (schemaInfo == null) { return new XmlName(prefix, localName, ns, hashCode, ownerDoc, next); } else { return new XmlNameEx(prefix, localName, ns, hashCode, ownerDoc, next, schemaInfo); } }
public XmlName AddName(string prefix, string localName, string ns, IXmlSchemaInfo schemaInfo) { if (prefix == null) { prefix = string.Empty; } if (ns == null) { ns = string.Empty; } int hashCode = XmlName.GetHashCode(localName); for (XmlName name = this.entries[hashCode & this.mask]; name != null; name = name.next) { if ((((name.HashCode == hashCode) && ((name.LocalName == localName) || name.LocalName.Equals(localName))) && ((name.Prefix == prefix) || name.Prefix.Equals(prefix))) && (((name.NamespaceURI == ns) || name.NamespaceURI.Equals(ns)) && name.Equals(schemaInfo))) { return(name); } } prefix = this.nameTable.Add(prefix); localName = this.nameTable.Add(localName); ns = this.nameTable.Add(ns); int index = hashCode & this.mask; XmlName name2 = XmlName.Create(prefix, localName, ns, hashCode, this.ownerDocument, this.entries[index], schemaInfo); this.entries[index] = name2; if (this.count++ == this.mask) { this.Grow(); } return(name2); }