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

◆ GetElements< T >()

static IEnumerable< XElement > System.Xml.Linq.Extensions.GetElements< T > ( IEnumerable< T > source,
XName name )
inlinestaticprivate
Type Constraints
T :XContainer 

Definition at line 367 of file Extensions.cs.

367 : XContainer
368 {
369 foreach (T root in source)
370 {
371 if (root == null)
372 {
373 continue;
374 }
375 XNode i = root.content as XNode;
376 if (i == null)
377 {
378 continue;
379 }
380 do
381 {
382 i = i.next;
383 if (i is XElement xElement && (name == null || xElement.name == name))
384 {
385 yield return xElement;
386 }
387 }
388 while (i.parent == root && i != root.content);
389 }
390 }

References System.Xml.Dictionary, and System.source.