Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XDeferredAxis.cs
Go to the documentation of this file.
1using System;
4using System.Linq;
6
8
9internal sealed class XDeferredAxis<T> : IEnumerable<T>, IEnumerable where T : XObject
10{
12
13 internal XElement element;
14
15 internal XName name;
16
17 public IEnumerable<T> this[string expandedName]
18 {
19 get
20 {
21 if (expandedName == null)
22 {
23 throw new ArgumentNullException("expandedName");
24 }
25 if (name == null)
26 {
28 }
29 else if (name != expandedName)
30 {
31 return Enumerable.Empty<T>();
32 }
33 return this;
34 }
35 }
36
38 {
39 if (func == null)
40 {
41 throw new ArgumentNullException("func");
42 }
43 if (element == null)
44 {
45 throw new ArgumentNullException("element");
46 }
47 _func = func;
48 this.element = element;
49 this.name = name;
50 }
51
53 {
55 }
56
61}
readonly Func< XElement, XName, IEnumerable< T > > _func
XDeferredAxis(Func< XElement, XName, IEnumerable< T > > func, XElement element, XName name)
new IEnumerator< T > GetEnumerator()