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

◆ LookupAttributePrefix()

string System.Xml.XmlBaseWriter.NamespaceManager.LookupAttributePrefix ( string ns)
inline

Definition at line 547 of file XmlBaseWriter.cs.

548 {
549 if (_lastNameSpace != null && _lastNameSpace.Uri == ns && _lastNameSpace.Prefix.Length != 0)
550 {
551 return _lastNameSpace.Prefix;
552 }
553 int nsCount = _nsCount;
554 for (int num = nsCount - 1; num >= _nsTop; num--)
555 {
556 Namespace @namespace = _namespaces[num];
557 if ((object)@namespace.Uri == ns)
558 {
559 string prefix = @namespace.Prefix;
560 if (prefix.Length != 0)
561 {
562 bool flag = false;
563 for (int i = num + 1; i < nsCount; i++)
564 {
565 if (_namespaces[i].Prefix == prefix)
566 {
567 flag = true;
568 break;
569 }
570 }
571 if (!flag)
572 {
573 _lastNameSpace = @namespace;
574 return prefix;
575 }
576 }
577 }
578 }
579 for (int num2 = nsCount - 1; num2 >= _nsTop; num2--)
580 {
582 if (namespace2.Uri == ns)
583 {
584 string prefix2 = namespace2.Prefix;
585 if (prefix2.Length != 0)
586 {
587 bool flag2 = false;
588 for (int j = num2 + 1; j < nsCount; j++)
589 {
590 if (_namespaces[j].Prefix == prefix2)
591 {
592 flag2 = true;
593 break;
594 }
595 }
596 if (!flag2)
597 {
599 return prefix2;
600 }
601 }
602 }
603 }
604 if (ns.Length == 0)
605 {
606 return string.Empty;
607 }
608 return null;
609 }

References System.Xml.XmlBaseWriter.NamespaceManager._lastNameSpace, System.Xml.XmlBaseWriter.NamespaceManager._namespaces, System.Xml.XmlBaseWriter.NamespaceManager._nsCount, System.Xml.XmlBaseWriter.NamespaceManager._nsTop, System.Runtime.Serialization.Dictionary, System.Xml.Dictionary, System.prefix, System.Xml.XmlBaseWriter.NamespaceManager.Namespace.Prefix, and System.Xml.XmlBaseWriter.NamespaceManager.Namespace.Uri.

Referenced by System.Xml.XmlBaseWriter.StartAttribute().