Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AddNamespace()

virtual void System.Xml.XmlNamespaceManager.AddNamespace ( string prefix,
string uri )
inlinevirtualinherited

Reimplemented in System.Xml.XmlTextReaderImpl.NoNamespaceManager.

Definition at line 102 of file XmlNamespaceManager.cs.

103 {
104 if (uri == null)
105 {
106 throw new ArgumentNullException("uri");
107 }
108 if (prefix == null)
109 {
110 throw new ArgumentNullException("prefix");
111 }
113 uri = _nameTable.Add(uri);
114 if (Ref.Equal(_xml, prefix) && !uri.Equals("http://www.w3.org/XML/1998/namespace"))
115 {
117 }
118 if (Ref.Equal(_xmlNs, prefix))
119 {
121 }
122 int num = LookupNamespaceDecl(prefix);
123 int previousNsIndex = -1;
124 if (num != -1)
125 {
126 if (_nsdecls[num].scopeId == _scopeId)
127 {
128 _nsdecls[num].uri = uri;
129 return;
130 }
131 previousNsIndex = num;
132 }
133 if (_lastDecl == _nsdecls.Length - 1)
134 {
135 NamespaceDeclaration[] array = new NamespaceDeclaration[_nsdecls.Length * 2];
136 Array.Copy(_nsdecls, array, _nsdecls.Length);
137 _nsdecls = array;
138 }
139 _nsdecls[++_lastDecl].Set(prefix, uri, _scopeId, previousNsIndex);
140 if (_useHashtable)
141 {
143 }
144 else if (_lastDecl >= 16)
145 {
147 for (int i = 0; i <= _lastDecl; i++)
148 {
150 }
151 _useHashtable = true;
152 }
153 }
static string Xml_XmlPrefix
Definition SR.cs:304
static string Xml_XmlnsPrefix
Definition SR.cs:306
Definition SR.cs:7
string Add(char[] array, int offset, int length)
Dictionary< string, int > _hashTable
void Set(string prefix, string uri, int scopeId, int previousNsIndex)

References System.Xml.XmlNamespaceManager._hashTable, System.Xml.XmlNamespaceManager._lastDecl, System.Xml.XmlNamespaceManager._nameTable, System.Xml.XmlNamespaceManager._nsdecls, System.Xml.XmlNamespaceManager._scopeId, System.Xml.XmlNamespaceManager._useHashtable, System.Xml.XmlNamespaceManager._xml, System.Xml.XmlNamespaceManager._xmlNs, System.Xml.XmlNameTable.Add(), System.Xml.ArgumentException, System.array, System.Array.Copy(), System.Xml.Dictionary, System.Xml.Ref.Equal(), System.Xml.XmlNamespaceManager.LookupNamespaceDecl(), System.prefix, System.Xml.XmlNamespaceManager.NamespaceDeclaration.prefix, System.Xml.XmlNamespaceManager.NamespaceDeclaration.Set(), System.Xml.XmlNamespaceManager.NamespaceDeclaration.uri, System.SR.Xml_XmlnsPrefix, and System.SR.Xml_XmlPrefix.

Referenced by System.Xml.Schema.XmlSchemaInference.XmlSchemaInference(), System.Xml.Schema.XmlSchemaInference.AddAttribute(), System.Xml.Xsl.Runtime.XmlQueryOutput.AddNamespace(), System.Xml.XmlSubtreeReader.AddNamespace(), System.Xml.XmlTextReaderImpl.AddNamespace(), System.Xml.Xsl.IlGen.XmlILNamespaceAnalyzer.Analyze(), System.Xml.Xsl.IlGen.XmlILNamespaceAnalyzer.CheckNamespaceInScope(), System.Xml.Schema.Parser.CreateXmlNsAttribute(), System.Xml.Schema.Parser.LoadElementNode(), System.Xml.Schema.Parser.ParseReaderNode(), System.Xml.XsdValidatingReader.ProcessElementEvent(), System.Xml.XsdValidatingReader.ProcessElementEventAsync(), System.Xml.XmlSubtreeReader.ProcessNamespaces(), System.Xml.Schema.XsdValidator.ProcessXsiAttributes(), System.Xml.Schema.XNodeValidator.PushAncestorsAndSelf(), System.Xml.Schema.XNodeValidator.PushElement(), System.Runtime.Serialization.XPathQueryGenerator.ExportContext.SetNamespace(), System.Xml.Schema.XdrValidator.ThoroughGetElementDecl(), System.Xml.DocumentSchemaValidator.ValidateElement(), and System.Xml.DocumentSchemaValidator.ValidateSingleElement().