public static Create ( string prefix, string localName, string ns, int hashCode, |
||
prefix | string | |
localName | string | |
ns | string | |
hashCode | int | |
ownerDoc | ||
next | ||
schemaInfo | IXmlSchemaInfo | |
return |
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); }
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 e = _entries[hashCode & _mask]; e != null; e = e.next) { if (e.HashCode == hashCode && ((object)e.LocalName == (object)localName || e.LocalName.Equals(localName)) && ((object)e.Prefix == (object)prefix || e.Prefix.Equals(prefix)) && ((object)e.NamespaceURI == (object)ns || e.NamespaceURI.Equals(ns)) && e.Equals(schemaInfo)) { return(e); } } prefix = _nameTable.Add(prefix); localName = _nameTable.Add(localName); ns = _nameTable.Add(ns); int index = hashCode & _mask; XmlName name = XmlName.Create(prefix, localName, ns, hashCode, _ownerDocument, _entries[index], schemaInfo); _entries[index] = name; if (_count++ == _mask) { Grow(); } return(name); }
public XmlName AddName(string prefix, string localName, string ns) { if (prefix == null) { prefix = string.Empty; } if (ns == null) { ns = string.Empty; } int hashCode = XmlNameHelper.GetHashCode(localName); for (XmlName e = entries[hashCode & mask]; e != null; e = e.next) { if (e.HashCode == hashCode && ((object)e.LocalName == (object)localName || e.LocalName.Equals(localName)) && ((object)e.Prefix == (object)prefix || e.Prefix.Equals(prefix)) && ((object)e.NamespaceURI == (object)ns || e.NamespaceURI.Equals(ns))) { return(e); } } prefix = nameTable.Add(prefix); localName = nameTable.Add(localName); ns = nameTable.Add(ns); int index = hashCode & mask; XmlName name = XmlName.Create(prefix, localName, ns, hashCode, ownerDocument, entries[index]); entries[index] = name; if (count++ == mask) { Grow(); } return(name); }