Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
FunctionQuery.cs
Go to the documentation of this file.
1using System;
5
7
8internal sealed class FunctionQuery : ExtensionQuery
9{
10 private readonly IList<Query> _args;
11
13
15 {
16 get
17 {
20 {
22 }
23 return xPathResultType;
24 }
25 }
26
27 public FunctionQuery(string prefix, string name, List<Query> args)
28 : base(prefix, name)
29 {
30 _args = args;
31 }
32
34 : base(other)
35 {
36 _function = other._function;
37 Query[] array = new Query[other._args.Count];
38 for (int i = 0; i < array.Length; i++)
39 {
40 array[i] = Query.Clone(other._args[i]);
41 }
42 _args = array;
43 _args = array;
44 }
45
46 public override void SetXsltContext(XsltContext context)
47 {
48 if (context == null)
49 {
51 }
52 if (xsltContext == context)
53 {
54 return;
55 }
56 xsltContext = context;
57 foreach (Query arg in _args)
58 {
59 arg.SetXsltContext(context);
60 }
62 for (int i = 0; i < _args.Count; i++)
63 {
64 array[i] = _args[i].StaticType;
65 }
67 if (_function == null)
68 {
70 }
71 }
72
73 public override object Evaluate(XPathNodeIterator nodeIterator)
74 {
75 if (xsltContext == null)
76 {
78 }
79 object[] array = new object[_args.Count];
80 for (int i = 0; i < _args.Count; i++)
81 {
82 array[i] = _args[i].Evaluate(nodeIterator);
84 {
85 array[i] = new XPathSelectionIterator(nodeIterator.Current, _args[i]);
86 }
87 }
88 try
89 {
91 }
93 {
95 }
96 }
97
99 {
100 if (name != "key" && prefix.Length != 0)
101 {
103 }
106 while ((xPathNavigator = Advance()) != null)
107 {
108 if (xPathNavigator.IsSamePosition(navigator))
109 {
110 return xPathNavigator;
111 }
112 }
113 return xPathNavigator;
114 }
115
116 public override XPathNodeIterator Clone()
117 {
118 return new FunctionQuery(this);
119 }
120}
override XPathNavigator Advance()
FunctionQuery(string prefix, string name, List< Query > args)
override object Evaluate(XPathNodeIterator nodeIterator)
readonly IList< Query > _args
override void SetXsltContext(XsltContext context)
override XPathNodeIterator Clone()
override XPathResultType StaticType
override XPathNavigator MatchNode(XPathNavigator navigator)
static Query Clone(Query input)
Definition Query.cs:66
static string Xp_FunctionFailed
Definition SR.cs:1262
static string Xp_NoContext
Definition SR.cs:1256
static string Xp_InvalidPattern
Definition SR.cs:1248
static string Xp_UndefFunc
Definition SR.cs:1260
Definition SR.cs:7
static XPathException Create(string res)
IXsltContextFunction ResolveFunction(string prefix, string name, XPathResultType[] ArgTypes)
object Invoke(XsltContext xsltContext, object[] args, XPathNavigator docContext)