372 references to ElementType
Mono.Cecil (372)
Mono.Cecil.Cil\CodeWriter.cs (1)
449
if (method.ReturnType.etype !=
ElementType
.Void || instruction.opcode.Code == Code.Newobj)
Mono.Cecil\ArrayType.cs (2)
128
this.etype = MD.
ElementType
.Array;
142
this.etype = MD.
ElementType
.Array;
Mono.Cecil\AssemblyReader.cs (93)
1359
case
ElementType
.Boolean:
1360
case
ElementType
.U1:
1361
case
ElementType
.I1:
1364
case
ElementType
.U2:
1365
case
ElementType
.I2:
1366
case
ElementType
.Char:
1369
case
ElementType
.U4:
1370
case
ElementType
.I4:
1371
case
ElementType
.R4:
1374
case
ElementType
.U8:
1375
case
ElementType
.I8:
1376
case
ElementType
.R8:
1379
case
ElementType
.Ptr:
1380
case
ElementType
.FnPtr:
1383
case
ElementType
.CModOpt:
1384
case
ElementType
.CModReqD:
2400
var constants = metadata.Constants = new Dictionary<MetadataToken, Row<
ElementType
, uint>> (length);
2403
var
type = (
ElementType
) ReadUInt16 ();
2407
constants.Add (owner, new Row<
ElementType
, uint> (type, signature));
2429
Row<
ElementType
, uint> row;
2438
object ReadConstantValue (
ElementType
etype, uint signature)
2441
case
ElementType
.Class:
2442
case
ElementType
.Object:
2444
case
ElementType
.String:
2466
object ReadConstantPrimitive (
ElementType
type, uint signature)
2996
if (type.etype ==
ElementType
.String) {
3009
} else if (type.etype ==
ElementType
.Object || type.etype ==
ElementType
.None || type.etype ==
ElementType
.Class || type.etype ==
ElementType
.Array || type.etype ==
ElementType
.GenericInst) {
3384
return ReadTypeSignature ((
ElementType
) ReadByte ());
3392
TypeReference ReadTypeSignature (
ElementType
etype)
3395
case
ElementType
.ValueType: {
3400
case
ElementType
.Class:
3402
case
ElementType
.Ptr:
3404
case
ElementType
.FnPtr: {
3409
case
ElementType
.ByRef:
3411
case
ElementType
.Pinned:
3413
case
ElementType
.SzArray:
3415
case
ElementType
.Array:
3417
case
ElementType
.CModOpt:
3420
case
ElementType
.CModReqD:
3423
case
ElementType
.Sentinel:
3425
case
ElementType
.Var:
3427
case
ElementType
.MVar:
3429
case
ElementType
.GenericInst: {
3430
var is_value_type = ReadByte () == (byte)
ElementType
.ValueType;
3445
case
ElementType
.Object: return TypeSystem.Object;
3446
case
ElementType
.Void: return TypeSystem.Void;
3447
case
ElementType
.TypedByRef: return TypeSystem.TypedReference;
3448
case
ElementType
.I: return TypeSystem.IntPtr;
3449
case
ElementType
.U: return TypeSystem.UIntPtr;
3503
public object ReadConstantSignature (
ElementType
type)
3596
type.etype ==
ElementType
.Object
3603
var
etype = type.etype;
3604
if (etype ==
ElementType
.GenericInst) {
3612
case
ElementType
.String:
3614
case
ElementType
.None:
3624
object ReadPrimitiveValue (
ElementType
type)
3627
case
ElementType
.Boolean:
3629
case
ElementType
.I1:
3631
case
ElementType
.U1:
3633
case
ElementType
.Char:
3635
case
ElementType
.I2:
3637
case
ElementType
.U2:
3639
case
ElementType
.I4:
3641
case
ElementType
.U4:
3643
case
ElementType
.I8:
3645
case
ElementType
.U8:
3647
case
ElementType
.R4:
3649
case
ElementType
.R8:
3656
TypeReference GetPrimitiveType (
ElementType
etype)
3659
case
ElementType
.Boolean:
3661
case
ElementType
.Char:
3663
case
ElementType
.I1:
3665
case
ElementType
.U1:
3667
case
ElementType
.I2:
3669
case
ElementType
.U2:
3671
case
ElementType
.I4:
3673
case
ElementType
.U4:
3675
case
ElementType
.I8:
3677
case
ElementType
.U8:
3679
case
ElementType
.R4:
3681
case
ElementType
.R8:
3683
case
ElementType
.String:
3692
var
etype = (
ElementType
) ReadByte ();
3695
case
ElementType
.Boxed:
3697
case
ElementType
.SzArray:
3699
case
ElementType
.Enum:
3701
case
ElementType
.Type:
Mono.Cecil\AssemblyWriter.cs (97)
41
using ConstantRow = Row<
ElementType
, CodedRID, BlobIndex>;
1895
var
etype = GetConstantType (type, constant);
1903
static
ElementType
GetConstantType (TypeReference constant_type, object constant)
1906
return
ElementType
.Class;
1908
var
etype = constant_type.etype;
1910
case
ElementType
.None:
1915
return
ElementType
.Class;
1916
case
ElementType
.String:
1917
return
ElementType
.String;
1918
case
ElementType
.Object:
1920
case
ElementType
.Array:
1921
case
ElementType
.SzArray:
1922
case
ElementType
.MVar:
1923
case
ElementType
.Var:
1924
return
ElementType
.Class;
1925
case
ElementType
.GenericInst:
1931
case
ElementType
.CModOpt:
1932
case
ElementType
.CModReqD:
1933
case
ElementType
.ByRef:
1934
case
ElementType
.Sentinel:
1936
case
ElementType
.Boolean:
1937
case
ElementType
.Char:
1938
case
ElementType
.I:
1939
case
ElementType
.I1:
1940
case
ElementType
.I2:
1941
case
ElementType
.I4:
1942
case
ElementType
.I8:
1943
case
ElementType
.U:
1944
case
ElementType
.U1:
1945
case
ElementType
.U2:
1946
case
ElementType
.U4:
1947
case
ElementType
.U8:
1948
case
ElementType
.R4:
1949
case
ElementType
.R8:
1956
static
ElementType
GetConstantType (Type type)
1960
return
ElementType
.Boolean;
1962
return
ElementType
.U1;
1964
return
ElementType
.I1;
1966
return
ElementType
.Char;
1968
return
ElementType
.I2;
1970
return
ElementType
.U2;
1972
return
ElementType
.I4;
1974
return
ElementType
.U4;
1976
return
ElementType
.I8;
1978
return
ElementType
.U8;
1980
return
ElementType
.R4;
1982
return
ElementType
.R8;
1984
return
ElementType
.String;
2208
SignatureWriter GetConstantSignature (
ElementType
type, object value)
2213
case
ElementType
.Array:
2214
case
ElementType
.SzArray:
2215
case
ElementType
.Class:
2216
case
ElementType
.Object:
2217
case
ElementType
.None:
2218
case
ElementType
.Var:
2219
case
ElementType
.MVar:
2220
case
ElementType
.GenericInst:
2223
case
ElementType
.String:
2713
public void WriteElementType (
ElementType
element_type)
2780
var
etype = type.etype;
2783
case
ElementType
.MVar:
2784
case
ElementType
.Var: {
2796
case
ElementType
.GenericInst: {
2798
WriteElementType (
ElementType
.GenericInst);
2799
WriteElementType (generic_instance.IsValueType ?
ElementType
.ValueType :
ElementType
.Class);
2806
case
ElementType
.Ptr:
2807
case
ElementType
.ByRef:
2808
case
ElementType
.Pinned:
2809
case
ElementType
.Sentinel: {
2816
case
ElementType
.FnPtr: {
2818
WriteElementType (
ElementType
.FnPtr);
2823
case
ElementType
.CModOpt:
2824
case
ElementType
.CModReqD: {
2830
case
ElementType
.Array: {
2837
WriteElementType (
ElementType
.SzArray);
2842
case
ElementType
.None: {
2843
WriteElementType (type.IsValueType ?
ElementType
.ValueType :
ElementType
.Class);
2859
WriteElementType (
ElementType
.Array);
2909
void WriteModifierSignature (
ElementType
element_type, IModifierType type)
2918
var
element = type.etype;
2920
if (element ==
ElementType
.None)
2995
if (type.etype ==
ElementType
.Object) {
3009
var
etype = type.etype;
3012
case
ElementType
.String:
3019
case
ElementType
.None:
3025
case
ElementType
.GenericInst:
3116
WriteElementType (
ElementType
.SzArray);
3121
var
etype = type.etype;
3124
case
ElementType
.Object:
3125
WriteElementType (
ElementType
.Boxed);
3127
case
ElementType
.None:
3129
WriteElementType (
ElementType
.Type);
3131
WriteElementType (
ElementType
.Enum);
3135
case
ElementType
.GenericInst:
3140
WriteElementType (
ElementType
.Enum);
Mono.Cecil\FunctionPointerType.cs (1)
98
this.etype = MD.
ElementType
.FnPtr;
Mono.Cecil\GenericInstanceType.cs (1)
67
this.etype = MD.
ElementType
.GenericInst;
Mono.Cecil\GenericParameter.cs (3)
206
static
ElementType
ConvertGenericParameterType (GenericParameterType type)
210
return
ElementType
.Var;
212
return
ElementType
.MVar;
Mono.Cecil\Import.cs (35)
141
static readonly Dictionary<Type,
ElementType
> type_etype_mapping = new Dictionary<Type,
ElementType
> (18) {
142
{ typeof (void),
ElementType
.Void },
143
{ typeof (bool),
ElementType
.Boolean },
144
{ typeof (char),
ElementType
.Char },
145
{ typeof (sbyte),
ElementType
.I1 },
146
{ typeof (byte),
ElementType
.U1 },
147
{ typeof (short),
ElementType
.I2 },
148
{ typeof (ushort),
ElementType
.U2 },
149
{ typeof (int),
ElementType
.I4 },
150
{ typeof (uint),
ElementType
.U4 },
151
{ typeof (long),
ElementType
.I8 },
152
{ typeof (ulong),
ElementType
.U8 },
153
{ typeof (float),
ElementType
.R4 },
154
{ typeof (double),
ElementType
.R8 },
155
{ typeof (string),
ElementType
.String },
156
{ typeof (TypedReference),
ElementType
.TypedByRef },
157
{ typeof (IntPtr),
ElementType
.I },
158
{ typeof (UIntPtr),
ElementType
.U },
159
{ typeof (object),
ElementType
.Object },
302
static
ElementType
ImportElementType (Type type)
304
ElementType
etype;
306
return
ElementType
.None;
588
case
ElementType
.SzArray:
591
case
ElementType
.Ptr:
594
case
ElementType
.ByRef:
597
case
ElementType
.Pinned:
600
case
ElementType
.Sentinel:
603
case
ElementType
.FnPtr:
620
case
ElementType
.CModOpt:
625
case
ElementType
.CModReqD:
630
case
ElementType
.Array:
648
case
ElementType
.GenericInst:
659
case
ElementType
.Var:
664
case
ElementType
.MVar:
Mono.Cecil\MetadataSystem.cs (45)
51
internal Dictionary<MetadataToken, Row<
ElementType
, uint>> Constants;
68
static Dictionary<string, Row<
ElementType
, bool>> primitive_value_types;
72
var types = new Dictionary<string, Row<
ElementType
, bool>> (18, StringComparer.Ordinal) {
73
{ "Void", new Row<
ElementType
, bool> (
ElementType
.Void, false) },
74
{ "Boolean", new Row<
ElementType
, bool> (
ElementType
.Boolean, true) },
75
{ "Char", new Row<
ElementType
, bool> (
ElementType
.Char, true) },
76
{ "SByte", new Row<
ElementType
, bool> (
ElementType
.I1, true) },
77
{ "Byte", new Row<
ElementType
, bool> (
ElementType
.U1, true) },
78
{ "Int16", new Row<
ElementType
, bool> (
ElementType
.I2, true) },
79
{ "UInt16", new Row<
ElementType
, bool> (
ElementType
.U2, true) },
80
{ "Int32", new Row<
ElementType
, bool> (
ElementType
.I4, true) },
81
{ "UInt32", new Row<
ElementType
, bool> (
ElementType
.U4, true) },
82
{ "Int64", new Row<
ElementType
, bool> (
ElementType
.I8, true) },
83
{ "UInt64", new Row<
ElementType
, bool> (
ElementType
.U8, true) },
84
{ "Single", new Row<
ElementType
, bool> (
ElementType
.R4, true) },
85
{ "Double", new Row<
ElementType
, bool> (
ElementType
.R8, true) },
86
{ "String", new Row<
ElementType
, bool> (
ElementType
.String, false) },
87
{ "TypedReference", new Row<
ElementType
, bool> (
ElementType
.TypedByRef, false) },
88
{ "IntPtr", new Row<
ElementType
, bool> (
ElementType
.I, true) },
89
{ "UIntPtr", new Row<
ElementType
, bool> (
ElementType
.U, true) },
90
{ "Object", new Row<
ElementType
, bool> (
ElementType
.Object, false) },
105
Row<
ElementType
, bool> primitive_data;
113
public static bool TryGetPrimitiveElementType (TypeDefinition type, out
ElementType
etype)
115
etype =
ElementType
.None;
120
Row<
ElementType
, bool> primitive_data;
129
static bool TryGetPrimitiveData (TypeReference type, out Row<
ElementType
, bool> primitive_data)
146
if (Constants != null) Constants = new Dictionary<MetadataToken, Row<
ElementType
, uint>> (capacity: 0);
Mono.Cecil\Modifiers.cs (2)
63
this.etype = MD.
ElementType
.CModOpt;
108
this.etype = MD.
ElementType
.CModReqD;
Mono.Cecil\PinnedType.cs (1)
32
this.etype = MD.
ElementType
.Pinned;
Mono.Cecil\PointerType.cs (1)
40
this.etype = MD.
ElementType
.Ptr;
Mono.Cecil\ReferenceType.cs (1)
40
this.etype = MD.
ElementType
.ByRef;
Mono.Cecil\SentinelType.cs (1)
32
this.etype = MD.
ElementType
.Sentinel;
Mono.Cecil\TypeDefinition.cs (2)
450
ElementType
primitive_etype;
457
ElementType
primitive_etype;
Mono.Cecil\TypeParser.cs (5)
474
case
ElementType
.Ptr:
477
case
ElementType
.ByRef:
480
case
ElementType
.SzArray:
481
case
ElementType
.Array:
492
case
ElementType
.GenericInst:
Mono.Cecil\TypeReference.cs (61)
19
Void =
ElementType
.Void,
20
Boolean =
ElementType
.Boolean,
21
Char =
ElementType
.Char,
22
SByte =
ElementType
.I1,
23
Byte =
ElementType
.U1,
24
Int16 =
ElementType
.I2,
25
UInt16 =
ElementType
.U2,
26
Int32 =
ElementType
.I4,
27
UInt32 =
ElementType
.U4,
28
Int64 =
ElementType
.I8,
29
UInt64 =
ElementType
.U8,
30
Single =
ElementType
.R4,
31
Double =
ElementType
.R8,
32
String =
ElementType
.String,
33
Pointer =
ElementType
.Ptr,
34
ByReference =
ElementType
.ByRef,
35
ValueType =
ElementType
.ValueType,
36
Class =
ElementType
.Class,
37
Var =
ElementType
.Var,
38
Array =
ElementType
.Array,
39
GenericInstance =
ElementType
.GenericInst,
40
TypedByReference =
ElementType
.TypedByRef,
41
IntPtr =
ElementType
.I,
42
UIntPtr =
ElementType
.U,
43
FunctionPointer =
ElementType
.FnPtr,
44
Object =
ElementType
.Object,
45
MVar =
ElementType
.MVar,
46
RequiredModifier =
ElementType
.CModReqD,
47
OptionalModifier =
ElementType
.CModOpt,
48
Sentinel =
ElementType
.Sentinel,
49
Pinned =
ElementType
.Pinned,
59
internal
ElementType
etype =
ElementType
.None;
231
case
ElementType
.None:
286
public static bool IsPrimitive (this
ElementType
self)
289
case
ElementType
.Boolean:
290
case
ElementType
.Char:
291
case
ElementType
.I:
292
case
ElementType
.U:
293
case
ElementType
.I1:
294
case
ElementType
.U1:
295
case
ElementType
.I2:
296
case
ElementType
.U2:
297
case
ElementType
.I4:
298
case
ElementType
.U4:
299
case
ElementType
.I8:
300
case
ElementType
.U8:
301
case
ElementType
.R4:
302
case
ElementType
.R8:
325
case
ElementType
.Array:
326
case
ElementType
.ByRef:
327
case
ElementType
.CModOpt:
328
case
ElementType
.CModReqD:
329
case
ElementType
.FnPtr:
330
case
ElementType
.GenericInst:
331
case
ElementType
.MVar:
332
case
ElementType
.Pinned:
333
case
ElementType
.Ptr:
334
case
ElementType
.SzArray:
335
case
ElementType
.Sentinel:
336
case
ElementType
.Var:
Mono.Cecil\TypeSystem.cs (20)
169
TypeReference LookupSystemType (ref TypeReference reference, string name,
ElementType
element_type)
180
TypeReference LookupSystemValueType (ref TypeReference typeRef, string name,
ElementType
element_type)
208
get { return type_object ?? (LookupSystemType (ref type_object, "Object",
ElementType
.Object)); }
212
get { return type_void ?? (LookupSystemType (ref type_void, "Void",
ElementType
.Void)); }
216
get { return type_bool ?? (LookupSystemValueType (ref type_bool, "Boolean",
ElementType
.Boolean)); }
220
get { return type_char ?? (LookupSystemValueType (ref type_char, "Char",
ElementType
.Char)); }
224
get { return type_sbyte ?? (LookupSystemValueType (ref type_sbyte, "SByte",
ElementType
.I1)); }
228
get { return type_byte ?? (LookupSystemValueType (ref type_byte, "Byte",
ElementType
.U1)); }
232
get { return type_int16 ?? (LookupSystemValueType (ref type_int16, "Int16",
ElementType
.I2)); }
236
get { return type_uint16 ?? (LookupSystemValueType (ref type_uint16, "UInt16",
ElementType
.U2)); }
240
get { return type_int32 ?? (LookupSystemValueType (ref type_int32, "Int32",
ElementType
.I4)); }
244
get { return type_uint32 ?? (LookupSystemValueType (ref type_uint32, "UInt32",
ElementType
.U4)); }
248
get { return type_int64 ?? (LookupSystemValueType (ref type_int64, "Int64",
ElementType
.I8)); }
252
get { return type_uint64 ?? (LookupSystemValueType (ref type_uint64, "UInt64",
ElementType
.U8)); }
256
get { return type_single ?? (LookupSystemValueType (ref type_single, "Single",
ElementType
.R4)); }
260
get { return type_double ?? (LookupSystemValueType (ref type_double, "Double",
ElementType
.R8)); }
264
get { return type_intptr ?? (LookupSystemValueType (ref type_intptr, "IntPtr",
ElementType
.I)); }
268
get { return type_uintptr ?? (LookupSystemValueType (ref type_uintptr, "UIntPtr",
ElementType
.U)); }
272
get { return type_string ?? (LookupSystemType (ref type_string, "String",
ElementType
.String)); }
276
get { return type_typedref ?? (LookupSystemValueType (ref type_typedref, "TypedReference",
ElementType
.TypedByRef)); }