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

◆ Get() [2/2]

static XNamespace System.Xml.Linq.XNamespace.Get ( string namespaceName,
int index,
int count )
inlinestaticpackage

Definition at line 109 of file XNamespace.cs.

110 {
111 if (count == 0)
112 {
113 return None;
114 }
115 if (s_namespaces == null)
116 {
118 }
120 do
121 {
122 if (!s_namespaces.TryGetValue(namespaceName, index, count, out var value))
123 {
124 if (count == "http://www.w3.org/XML/1998/namespace".Length && string.CompareOrdinal(namespaceName, index, "http://www.w3.org/XML/1998/namespace", 0, count) == 0)
125 {
126 return Xml;
127 }
128 if (count == "http://www.w3.org/2000/xmlns/".Length && string.CompareOrdinal(namespaceName, index, "http://www.w3.org/2000/xmlns/", 0, count) == 0)
129 {
130 return Xmlns;
131 }
133 }
134 xNamespace = ((value != null && value.TryGetTarget(out var target)) ? target : null);
135 }
136 while (xNamespace == null);
137 return xNamespace;
138 }
static int CompareExchange(ref int location1, int value, int comparand)
static XNamespace Xmlns
Definition XNamespace.cs:28
static string ExtractNamespace(WeakReference< XNamespace > r)
static XNamespace None
Definition XNamespace.cs:24
XNamespace(string namespaceName)
Definition XNamespace.cs:30
static XNamespace Xml
Definition XNamespace.cs:26
static XHashtable< WeakReference< XNamespace > > s_namespaces
Definition XNamespace.cs:8

References System.Xml.Linq.XNamespace.XNamespace(), System.Threading.Interlocked.CompareExchange(), System.count, System.Xml.Dictionary, System.Xml.Linq.XNamespace.ExtractNamespace(), System.index, System.Xml.Linq.XNamespace.None, System.Xml.Linq.XNamespace.s_namespaces, System.value, System.Xml.Linq.XNamespace.Xml, and System.Xml.Linq.XNamespace.Xmlns.