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

◆ GetAttributes()

static IEnumerable< XAttribute > System.Xml.Linq.Extensions.GetAttributes ( IEnumerable< XElement > source,
XName name )
inlinestaticprivate

Definition at line 241 of file Extensions.cs.

242 {
243 foreach (XElement e in source)
244 {
245 if (e == null)
246 {
247 continue;
248 }
249 XAttribute a = e.lastAttr;
250 if (a == null)
251 {
252 continue;
253 }
254 do
255 {
256 a = a.next;
257 if (name == null || a.name == name)
258 {
259 yield return a;
260 }
261 }
262 while (a.parent == e && a != e.lastAttr);
263 }
264 }

References System.Xml.Dictionary, System.Xml.Linq.XElement.lastAttr, and System.source.

Referenced by System.Xml.Linq.Extensions.Attributes(), and System.Xml.Linq.Extensions.Attributes().