Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
VariableQuery.cs
Go to the documentation of this file.
1
using
System
;
2
using
System.Xml.XPath
;
3
using
System.Xml.Xsl
;
4
5
namespace
MS.Internal.Xml.XPath
;
6
7
internal
sealed
class
VariableQuery
:
ExtensionQuery
8
{
9
private
IXsltContextVariable
_variable
;
10
11
public
override
XPathResultType
StaticType
12
{
13
get
14
{
15
if
(
_variable
!=
null
)
16
{
17
return
GetXPathType
(
Evaluate
(
null
));
18
}
19
XPathResultType
xPathResultType = ((
_variable
!=
null
) ?
_variable
.
VariableType
:
XPathResultType
.Any);
20
if
(xPathResultType ==
XPathResultType
.Error)
21
{
22
xPathResultType =
XPathResultType
.Any;
23
}
24
return
xPathResultType;
25
}
26
}
27
28
public
VariableQuery
(
string
name
,
string
prefix
)
29
: base(
prefix
,
name
)
30
{
31
}
32
33
private
VariableQuery
(
VariableQuery
other
)
34
: base(
other
)
35
{
36
_variable
=
other
._variable;
37
}
38
39
public
override
void
SetXsltContext
(
XsltContext
context)
40
{
41
if
(context ==
null
)
42
{
43
throw
XPathException
.
Create
(
System
.
SR
.
Xp_NoContext
);
44
}
45
if
(
xsltContext
!= context)
46
{
47
xsltContext
= context;
48
_variable
=
xsltContext
.
ResolveVariable
(
prefix
,
name
);
49
if
(
_variable
==
null
)
50
{
51
throw
XPathException
.
Create
(
System
.
SR
.
Xp_UndefVar
, base.QName);
52
}
53
}
54
}
55
56
public
override
object
Evaluate
(
XPathNodeIterator
nodeIterator)
57
{
58
if
(
xsltContext
==
null
)
59
{
60
throw
XPathException
.
Create
(
System
.
SR
.
Xp_NoContext
);
61
}
62
return
ProcessResult
(
_variable
.
Evaluate
(
xsltContext
));
63
}
64
65
public
override
XPathNodeIterator
Clone
()
66
{
67
return
new
VariableQuery
(
this
);
68
}
69
}
MS.Internal.Xml.XPath.ExtensionQuery.name
string name
Definition
ExtensionQuery.cs:11
MS.Internal.Xml.XPath.ExtensionQuery.xsltContext
XsltContext xsltContext
Definition
ExtensionQuery.cs:13
MS.Internal.Xml.XPath.ExtensionQuery.ProcessResult
object ProcessResult(object value)
Definition
ExtensionQuery.cs:107
MS.Internal.Xml.XPath.ExtensionQuery.prefix
string prefix
Definition
ExtensionQuery.cs:9
MS.Internal.Xml.XPath.ExtensionQuery
Definition
ExtensionQuery.cs:8
MS.Internal.Xml.XPath.Query.GetXPathType
XPathResultType GetXPathType(object value)
Definition
Query.cs:147
MS.Internal.Xml.XPath.VariableQuery.StaticType
override XPathResultType StaticType
Definition
VariableQuery.cs:12
MS.Internal.Xml.XPath.VariableQuery.VariableQuery
VariableQuery(VariableQuery other)
Definition
VariableQuery.cs:33
MS.Internal.Xml.XPath.VariableQuery._variable
IXsltContextVariable _variable
Definition
VariableQuery.cs:9
MS.Internal.Xml.XPath.VariableQuery.VariableQuery
VariableQuery(string name, string prefix)
Definition
VariableQuery.cs:28
MS.Internal.Xml.XPath.VariableQuery.Clone
override XPathNodeIterator Clone()
Definition
VariableQuery.cs:65
MS.Internal.Xml.XPath.VariableQuery.Evaluate
override object Evaluate(XPathNodeIterator nodeIterator)
Definition
VariableQuery.cs:56
MS.Internal.Xml.XPath.VariableQuery.SetXsltContext
override void SetXsltContext(XsltContext context)
Definition
VariableQuery.cs:39
MS.Internal.Xml.XPath.VariableQuery
Definition
VariableQuery.cs:8
System.SR.Xp_UndefVar
static string Xp_UndefVar
Definition
SR.cs:1258
System.SR.Xp_NoContext
static string Xp_NoContext
Definition
SR.cs:1256
System.SR
Definition
SR.cs:7
System.Xml.XPath.XPathException.Create
static XPathException Create(string res)
Definition
XPathException.cs:77
System.Xml.XPath.XPathException
Definition
XPathException.cs:10
System.Xml.XPath.XPathNodeIterator
Definition
XPathNodeIterator.cs:8
System.Xml.Xsl.XsltContext.ResolveVariable
IXsltContextVariable ResolveVariable(string prefix, string name)
System.Xml.Xsl.XsltContext
Definition
XsltContext.cs:6
System.Xml.Xsl.IXsltContextVariable.VariableType
XPathResultType VariableType
Definition
IXsltContextVariable.cs:11
System.Xml.Xsl.IXsltContextVariable.Evaluate
object Evaluate(XsltContext xsltContext)
System.Xml.Xsl.IXsltContextVariable
Definition
IXsltContextVariable.cs:6
MS.Internal.Xml.XPath
Definition
AbsoluteQuery.cs:3
System.Xml.XPath.XPathResultType
XPathResultType
Definition
XPathResultType.cs:4
System.Xml.XPath
Definition
Extensions.cs:5
System.Xml.Xsl
Definition
BranchingContext.cs:1
System.ExceptionArgument.other
@ other
System
Definition
BlockingCollection.cs:8
source
System.Private.Xml
MS.Internal.Xml.XPath
VariableQuery.cs
Generated by
1.10.0