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

◆ MoveToFirstNamespace() [2/2]

override bool System.Xml.DocumentXPathNavigator.MoveToFirstNamespace ( XPathNamespaceScope scope)
inline

Definition at line 426 of file DocumentXPathNavigator.cs.

427 {
428 if (!(_source is XmlElement xmlElement))
429 {
430 return false;
431 }
432 int index = int.MaxValue;
433 switch (scope)
434 {
435 case XPathNamespaceScope.Local:
436 {
437 if (!xmlElement.HasAttributes)
438 {
439 return false;
440 }
441 XmlAttributeCollection attributes = xmlElement.Attributes;
442 if (!MoveToFirstNamespaceLocal(attributes, ref index))
443 {
444 return false;
445 }
446 _source = attributes[index];
449 break;
450 }
451 case XPathNamespaceScope.ExcludeXml:
452 {
453 XmlAttributeCollection attributes = xmlElement.Attributes;
454 if (!MoveToFirstNamespaceGlobal(ref attributes, ref index))
455 {
456 return false;
457 }
458 XmlAttribute xmlAttribute = attributes[index];
459 while (Ref.Equal(xmlAttribute.LocalName, _document.strXml))
460 {
461 if (!MoveToNextNamespaceGlobal(ref attributes, ref index))
462 {
463 return false;
464 }
465 xmlAttribute = attributes[index];
466 }
470 break;
471 }
472 case XPathNamespaceScope.All:
473 {
474 XmlAttributeCollection attributes = xmlElement.Attributes;
475 if (!MoveToFirstNamespaceGlobal(ref attributes, ref index))
476 {
478 }
479 else
480 {
481 _source = attributes[index];
483 }
485 break;
486 }
487 default:
488 return false;
489 }
490 return true;
491 }
static bool MoveToNextNamespaceGlobal(ref XmlAttributeCollection attributes, ref int index)
static bool MoveToFirstNamespaceLocal(XmlAttributeCollection attributes, ref int index)
static bool MoveToFirstNamespaceGlobal(ref XmlAttributeCollection attributes, ref int index)
XmlAttribute NamespaceXml

References System.Xml.DocumentXPathNavigator._attributeIndex, System.Xml.DocumentXPathNavigator._document, System.Xml.DocumentXPathNavigator._namespaceParent, System.Xml.DocumentXPathNavigator._source, System.Xml.Dictionary, System.Xml.Ref.Equal(), System.index, System.Xml.DocumentXPathNavigator.MoveToFirstNamespaceGlobal(), System.Xml.DocumentXPathNavigator.MoveToFirstNamespaceLocal(), System.Xml.DocumentXPathNavigator.MoveToNextNamespaceGlobal(), System.Xml.XmlDocument.NamespaceXml, and System.Xml.XmlDocument.strXml.