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

◆ GeneratePrefix()

string System.Xml.XmlBaseWriter.GeneratePrefix ( string ns,
XmlDictionaryString xNs )
inlineprivateinherited

Definition at line 2592 of file XmlBaseWriter.cs.

2593 {
2594 if (_writeState != WriteState.Element && _writeState != WriteState.Attribute)
2595 {
2597 }
2598 string text = _nsMgr.AddNamespace(ns, xNs);
2599 if (text != null)
2600 {
2601 return text;
2602 }
2603 do
2604 {
2605 int value = _elements[_depth].PrefixId++;
2608 handler.AppendLiteral("d");
2609 handler.AppendFormatted(_depth);
2610 handler.AppendLiteral("p");
2611 handler.AppendFormatted(value);
2612 text = string.Create(invariantCulture, ref handler);
2613 }
2614 while (_nsMgr.LookupNamespace(text) != null);
2616 return text;
2617 }
static CultureInfo InvariantCulture
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string XmlInvalidPrefixState
Definition SR.cs:436
Definition SR.cs:7
string AddNamespace(string uri, XmlDictionaryString uriDictionaryString)
readonly NamespaceManager _nsMgr

References System.Xml.XmlBaseWriter.NamespaceManager._depth, System.Xml.XmlBaseWriter._elements, System.Xml.XmlBaseWriter._nsMgr, System.Xml.XmlBaseWriter._writeState, System.Xml.XmlBaseWriter.NamespaceManager.AddNamespace(), System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendFormatted(), System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendLiteral(), System.Xml.Dictionary, System.SR.Format(), System.Globalization.CultureInfo.InvariantCulture, System.Xml.XmlBaseWriter.NamespaceManager.LookupNamespace(), System.Xml.XmlBaseWriter.Element.PrefixId, System.text, System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(), System.value, and System.SR.XmlInvalidPrefixState.

Referenced by System.Xml.XmlBaseWriter.GetQualifiedNamePrefix(), System.Xml.XmlBaseWriter.StartAttribute(), System.Xml.XmlBaseWriter.WriteXmlnsAttribute(), and System.Xml.XmlBaseWriter.WriteXmlnsAttribute().