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

◆ GetNamespacesInScope()

IDictionary< string, string > System.Xml.DocumentSchemaValidator.GetNamespacesInScope ( XmlNamespaceScope scope)
inline

Implements System.Xml.IXmlNamespaceResolver.

Definition at line 169 of file DocumentSchemaValidator.cs.

170 {
172 if (scope != XmlNamespaceScope.Local)
173 {
174 XmlNode xmlNode = _startNode;
175 while (xmlNode != null)
176 {
177 switch (xmlNode.NodeType)
178 {
179 case XmlNodeType.Element:
180 {
181 XmlElement xmlElement = (XmlElement)xmlNode;
182 if (xmlElement.HasAttributes)
183 {
184 XmlAttributeCollection attributes = xmlElement.Attributes;
185 for (int i = 0; i < attributes.Count; i++)
186 {
187 XmlAttribute xmlAttribute = attributes[i];
188 if (!Ref.Equal(xmlAttribute.NamespaceURI, _document.strReservedXmlns))
189 {
190 continue;
191 }
192 if (xmlAttribute.Prefix.Length == 0)
193 {
194 if (!namespacesInScope.ContainsKey(string.Empty))
195 {
197 }
198 }
199 else if (!namespacesInScope.ContainsKey(xmlAttribute.LocalName))
200 {
202 }
203 }
204 }
205 xmlNode = xmlNode.ParentNode;
206 break;
207 }
208 case XmlNodeType.Attribute:
209 xmlNode = ((XmlAttribute)xmlNode).OwnerElement;
210 break;
211 default:
212 xmlNode = xmlNode.ParentNode;
213 break;
214 }
215 }
216 }
217 return namespacesInScope;
218 }
void Add(TKey key, TValue value)
readonly XmlNamespaceManager _nsManager
virtual IDictionary< string, string > GetNamespacesInScope(XmlNamespaceScope scope)

References System.Xml.DocumentSchemaValidator._document, System.Xml.DocumentSchemaValidator._nsManager, System.Xml.DocumentSchemaValidator._startNode, System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Collections.Generic.Dictionary< TKey, TValue >.ContainsKey(), System.Xml.XmlAttributeCollection.Count, System.Xml.Dictionary, System.Xml.Ref.Equal(), System.Xml.XmlNamespaceManager.GetNamespacesInScope(), and System.Xml.XmlDocument.strReservedXmlns.