Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlILTypeHelper.cs
Go to the documentation of this file.
1
using
System.Collections.Generic
;
2
using
System.Xml.XPath
;
3
4
namespace
System.Xml.Xsl.IlGen
;
5
6
internal
static
class
XmlILTypeHelper
7
{
8
private
static
readonly
Type
[]
s_typeCodeToStorage
=
new
Type
[55]
9
{
10
typeof
(
XPathItem
),
11
typeof
(
XPathItem
),
12
typeof
(
XPathNavigator
),
13
typeof
(
XPathNavigator
),
14
typeof
(
XPathNavigator
),
15
typeof
(
XPathNavigator
),
16
typeof
(
XPathNavigator
),
17
typeof
(
XPathNavigator
),
18
typeof
(
XPathNavigator
),
19
typeof
(
XPathNavigator
),
20
typeof
(
XPathItem
),
21
typeof
(
string
),
22
typeof
(
string
),
23
typeof
(
bool
),
24
typeof
(decimal),
25
typeof
(
float
),
26
typeof
(
double
),
27
typeof
(
string
),
28
typeof
(
DateTime
),
29
typeof
(
DateTime
),
30
typeof
(
DateTime
),
31
typeof
(
DateTime
),
32
typeof
(
DateTime
),
33
typeof
(
DateTime
),
34
typeof
(
DateTime
),
35
typeof
(
DateTime
),
36
typeof
(
byte
[]),
37
typeof
(
byte
[]),
38
typeof
(
string
),
39
typeof
(
XmlQualifiedName
),
40
typeof
(
XmlQualifiedName
),
41
typeof
(
string
),
42
typeof
(
string
),
43
typeof
(
string
),
44
typeof
(
string
),
45
typeof
(
string
),
46
typeof
(
string
),
47
typeof
(
string
),
48
typeof
(
string
),
49
typeof
(
string
),
50
typeof
(
long
),
51
typeof
(decimal),
52
typeof
(decimal),
53
typeof
(
long
),
54
typeof
(
int
),
55
typeof
(
int
),
56
typeof
(
int
),
57
typeof
(decimal),
58
typeof
(decimal),
59
typeof
(
long
),
60
typeof
(
int
),
61
typeof
(
int
),
62
typeof
(decimal),
63
typeof
(
TimeSpan
),
64
typeof
(
TimeSpan
)
65
};
66
67
private
static
readonly
Type
[]
s_typeCodeToCachedStorage
=
new
Type
[55]
68
{
69
typeof
(
IList<XPathItem>
),
70
typeof
(
IList<XPathItem>
),
71
typeof
(
IList<XPathNavigator>
),
72
typeof
(
IList<XPathNavigator>
),
73
typeof
(
IList<XPathNavigator>
),
74
typeof
(
IList<XPathNavigator>
),
75
typeof
(
IList<XPathNavigator>
),
76
typeof
(
IList<XPathNavigator>
),
77
typeof
(
IList<XPathNavigator>
),
78
typeof
(
IList<XPathNavigator>
),
79
typeof
(
IList<XPathItem>
),
80
typeof
(
IList<string>
),
81
typeof
(
IList<string>
),
82
typeof
(
IList<bool>
),
83
typeof
(
IList<decimal>
),
84
typeof
(
IList<float>
),
85
typeof
(
IList<double>
),
86
typeof
(
IList<string>
),
87
typeof
(
IList<DateTime>
),
88
typeof
(
IList<DateTime>
),
89
typeof
(
IList<DateTime>
),
90
typeof
(
IList<DateTime>
),
91
typeof
(
IList<DateTime>
),
92
typeof
(
IList<DateTime>
),
93
typeof
(
IList<DateTime>
),
94
typeof
(
IList<DateTime>
),
95
typeof
(
IList
<
byte
[]>),
96
typeof
(
IList
<
byte
[]>),
97
typeof
(
IList<string>
),
98
typeof
(
IList<XmlQualifiedName>
),
99
typeof
(
IList<XmlQualifiedName>
),
100
typeof
(
IList<string>
),
101
typeof
(
IList<string>
),
102
typeof
(
IList<string>
),
103
typeof
(
IList<string>
),
104
typeof
(
IList<string>
),
105
typeof
(
IList<string>
),
106
typeof
(
IList<string>
),
107
typeof
(
IList<string>
),
108
typeof
(
IList<string>
),
109
typeof
(
IList<long>
),
110
typeof
(
IList<decimal>
),
111
typeof
(
IList<decimal>
),
112
typeof
(
IList<long>
),
113
typeof
(
IList<int>
),
114
typeof
(
IList<int>
),
115
typeof
(
IList<int>
),
116
typeof
(
IList<decimal>
),
117
typeof
(
IList<decimal>
),
118
typeof
(
IList<long>
),
119
typeof
(
IList<int>
),
120
typeof
(
IList<int>
),
121
typeof
(
IList<decimal>
),
122
typeof
(
IList<TimeSpan>
),
123
typeof
(
IList<TimeSpan>
)
124
};
125
126
public
static
Type
GetStorageType
(
XmlQueryType
qyTyp
)
127
{
128
Type
type
;
129
if
(
qyTyp
.IsSingleton)
130
{
131
type
=
s_typeCodeToStorage
[(int)
qyTyp
.TypeCode];
132
if
(!
qyTyp
.IsStrict &&
type
!=
typeof
(
XPathNavigator
))
133
{
134
return
typeof
(
XPathItem
);
135
}
136
}
137
else
138
{
139
type
=
s_typeCodeToCachedStorage
[(int)
qyTyp
.TypeCode];
140
if
(!
qyTyp
.IsStrict &&
type
!=
typeof
(
IList<XPathNavigator>
))
141
{
142
return
typeof
(
IList<XPathItem>
);
143
}
144
}
145
return
type
;
146
}
147
}
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.Type
Definition
Type.cs:14
System.Xml.XPath.XPathItem
Definition
XPathItem.cs:6
System.Xml.XPath.XPathNavigator
Definition
XPathNavigator.cs:15
System.Xml.XmlQualifiedName
Definition
XmlQualifiedName.cs:6
System.Xml.Xsl.IlGen.XmlILTypeHelper.GetStorageType
static Type GetStorageType(XmlQueryType qyTyp)
Definition
XmlILTypeHelper.cs:126
System.Xml.Xsl.IlGen.XmlILTypeHelper.s_typeCodeToStorage
static readonly Type[] s_typeCodeToStorage
Definition
XmlILTypeHelper.cs:8
System.Xml.Xsl.IlGen.XmlILTypeHelper.s_typeCodeToCachedStorage
static readonly Type[] s_typeCodeToCachedStorage
Definition
XmlILTypeHelper.cs:67
System.Xml.Xsl.IlGen.XmlILTypeHelper
Definition
XmlILTypeHelper.cs:7
System.Xml.Xsl.XmlQueryType
Definition
XmlQueryType.cs:9
System.Collections.Generic.IList
Definition
IList.cs:4
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
System.Xml.XPath
Definition
Extensions.cs:5
System.Xml.Xsl.IlGen
Definition
BranchingContext.cs:1
System.Xml.ValueHandleType.Dictionary
@ Dictionary
System.ExceptionArgument.type
@ type
System.DateTime
Definition
DateTime.cs:15
System.TimeSpan
Definition
TimeSpan.cs:10
source
System.Private.Xml
System.Xml.Xsl.IlGen
XmlILTypeHelper.cs
Generated by
1.10.0