Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CodedIndex.cs
Go to the documentation of this file.
2
3public static class CodedIndex
4{
6 {
7 MethodDef = 0,
8 Field = 1,
9 TypeRef = 2,
10 TypeDef = 3,
11 Param = 4,
12 InterfaceImpl = 5,
13 MemberRef = 6,
14 Module = 7,
15 DeclSecurity = 8,
16 Property = 9,
17 Event = 10,
18 StandAloneSig = 11,
19 ModuleRef = 12,
20 TypeSpec = 13,
21 Assembly = 14,
22 AssemblyRef = 15,
23 File = 16,
24 ExportedType = 17,
26 GenericParam = 19,
28 MethodSpec = 21,
29 BitCount = 5
30 }
31
32 private enum HasConstantTag
33 {
34 Field = 0,
35 Param = 1,
36 Property = 2,
37 BitCount = 2
38 }
39
41 {
42 MethodDef = 2,
43 MemberRef = 3,
44 BitCount = 3
45 }
46
47 private enum HasDeclSecurityTag
48 {
49 TypeDef = 0,
50 MethodDef = 1,
51 Assembly = 2,
52 BitCount = 2
53 }
54
55 private enum HasFieldMarshalTag
56 {
57 Field = 0,
58 Param = 1,
59 BitCount = 1
60 }
61
62 private enum HasSemanticsTag
63 {
64 Event = 0,
65 Property = 1,
66 BitCount = 1
67 }
68
69 private enum ImplementationTag
70 {
71 File = 0,
72 AssemblyRef = 1,
73 ExportedType = 2,
74 BitCount = 2
75 }
76
77 private enum MemberForwardedTag
78 {
79 Field = 0,
80 MethodDef = 1,
81 BitCount = 1
82 }
83
84 private enum MemberRefParentTag
85 {
86 TypeDef = 0,
87 TypeRef = 1,
88 ModuleRef = 2,
89 MethodDef = 3,
90 TypeSpec = 4,
91 BitCount = 3
92 }
93
94 private enum MethodDefOrRefTag
95 {
96 MethodDef = 0,
97 MemberRef = 1,
98 BitCount = 1
99 }
100
102 {
103 Module = 0,
104 ModuleRef = 1,
105 AssemblyRef = 2,
106 TypeRef = 3,
107 BitCount = 2
108 }
109
111 {
112 TypeDef = 0,
113 TypeRef = 1,
114 TypeSpec = 2,
115 BitCount = 2
116 }
117
118 private enum TypeDefOrRefTag
119 {
120 TypeDef,
121 TypeRef,
123 }
124
126 {
127 TypeDef = 0,
128 MethodDef = 1,
129 BitCount = 1
130 }
131
133 {
134 MethodDef = 0,
135 Field = 1,
136 TypeRef = 2,
137 TypeDef = 3,
138 Param = 4,
139 InterfaceImpl = 5,
140 MemberRef = 6,
141 Module = 7,
142 DeclSecurity = 8,
143 Property = 9,
144 Event = 10,
145 StandAloneSig = 11,
146 ModuleRef = 12,
147 TypeSpec = 13,
148 Assembly = 14,
149 AssemblyRef = 15,
150 File = 16,
151 ExportedType = 17,
152 ManifestResource = 18,
153 GenericParam = 19,
155 MethodSpec = 21,
156 Document = 22,
157 LocalScope = 23,
158 LocalVariable = 24,
159 LocalConstant = 25,
160 ImportScope = 26,
161 BitCount = 5
162 }
163
165 {
166 return (handle.RowId << 5) | (int)ToHasCustomAttributeTag(handle.Kind);
167 }
168
169 public static int HasConstant(EntityHandle handle)
170 {
171 return (handle.RowId << 2) | (int)ToHasConstantTag(handle.Kind);
172 }
173
175 {
176 return (handle.RowId << 3) | (int)ToCustomAttributeTypeTag(handle.Kind);
177 }
178
180 {
181 return (handle.RowId << 2) | (int)ToHasDeclSecurityTag(handle.Kind);
182 }
183
185 {
186 return (handle.RowId << 1) | (int)ToHasFieldMarshalTag(handle.Kind);
187 }
188
190 {
191 return (handle.RowId << 1) | (int)ToHasSemanticsTag(handle.Kind);
192 }
193
195 {
196 return (handle.RowId << 2) | (int)ToImplementationTag(handle.Kind);
197 }
198
200 {
201 return (handle.RowId << 1) | (int)ToMemberForwardedTag(handle.Kind);
202 }
203
205 {
206 return (handle.RowId << 3) | (int)ToMemberRefParentTag(handle.Kind);
207 }
208
210 {
211 return (handle.RowId << 1) | (int)ToMethodDefOrRefTag(handle.Kind);
212 }
213
215 {
216 return (handle.RowId << 2) | (int)ToResolutionScopeTag(handle.Kind);
217 }
218
220 {
221 return (handle.RowId << 2) | (int)ToTypeDefOrRefTag(handle.Kind);
222 }
223
225 {
226 return (handle.RowId << 2) | (int)ToTypeDefOrRefOrSpecTag(handle.Kind);
227 }
228
230 {
231 return (handle.RowId << 1) | (int)ToTypeOrMethodDefTag(handle.Kind);
232 }
233
235 {
236 return (handle.RowId << 5) | (int)ToHasCustomDebugInformationTag(handle.Kind);
237 }
238
240 {
241 switch (kind)
242 {
243 case HandleKind.MethodDefinition:
244 return HasCustomAttributeTag.MethodDef;
245 case HandleKind.FieldDefinition:
246 return HasCustomAttributeTag.Field;
247 case HandleKind.TypeReference:
248 return HasCustomAttributeTag.TypeRef;
249 case HandleKind.TypeDefinition:
250 return HasCustomAttributeTag.TypeDef;
251 case HandleKind.Parameter:
252 return HasCustomAttributeTag.Param;
253 case HandleKind.InterfaceImplementation:
254 return HasCustomAttributeTag.InterfaceImpl;
255 case HandleKind.MemberReference:
256 return HasCustomAttributeTag.MemberRef;
257 case HandleKind.ModuleDefinition:
258 return HasCustomAttributeTag.Module;
259 case HandleKind.DeclarativeSecurityAttribute:
260 return HasCustomAttributeTag.DeclSecurity;
261 case HandleKind.PropertyDefinition:
262 return HasCustomAttributeTag.Property;
263 case HandleKind.EventDefinition:
264 return HasCustomAttributeTag.Event;
265 case HandleKind.StandaloneSignature:
266 return HasCustomAttributeTag.StandAloneSig;
267 case HandleKind.ModuleReference:
268 return HasCustomAttributeTag.ModuleRef;
269 case HandleKind.TypeSpecification:
270 return HasCustomAttributeTag.TypeSpec;
271 case HandleKind.AssemblyDefinition:
272 return HasCustomAttributeTag.Assembly;
273 case HandleKind.AssemblyReference:
274 return HasCustomAttributeTag.AssemblyRef;
275 case HandleKind.AssemblyFile:
276 return HasCustomAttributeTag.File;
277 case HandleKind.ExportedType:
278 return HasCustomAttributeTag.ExportedType;
279 case HandleKind.ManifestResource:
280 return HasCustomAttributeTag.ManifestResource;
281 case HandleKind.GenericParameter:
282 return HasCustomAttributeTag.GenericParam;
283 case HandleKind.GenericParameterConstraint:
284 return HasCustomAttributeTag.GenericParamConstraint;
285 case HandleKind.MethodSpecification:
286 return HasCustomAttributeTag.MethodSpec;
287 default:
289 return HasCustomAttributeTag.MethodDef;
290 }
291 }
292
294 {
295 switch (kind)
296 {
297 case HandleKind.FieldDefinition:
298 return HasConstantTag.Field;
299 case HandleKind.Parameter:
300 return HasConstantTag.Param;
301 case HandleKind.PropertyDefinition:
302 return HasConstantTag.Property;
303 default:
305 return HasConstantTag.Field;
306 }
307 }
308
310 {
311 switch (kind)
312 {
313 case HandleKind.MethodDefinition:
314 return CustomAttributeTypeTag.MethodDef;
315 case HandleKind.MemberReference:
316 return CustomAttributeTypeTag.MemberRef;
317 default:
319 return (CustomAttributeTypeTag)0;
320 }
321 }
322
324 {
325 switch (kind)
326 {
327 case HandleKind.TypeDefinition:
328 return HasDeclSecurityTag.TypeDef;
329 case HandleKind.MethodDefinition:
330 return HasDeclSecurityTag.MethodDef;
331 case HandleKind.AssemblyDefinition:
332 return HasDeclSecurityTag.Assembly;
333 default:
335 return HasDeclSecurityTag.TypeDef;
336 }
337 }
338
340 {
341 switch (kind)
342 {
343 case HandleKind.FieldDefinition:
344 return HasFieldMarshalTag.Field;
345 case HandleKind.Parameter:
346 return HasFieldMarshalTag.Param;
347 default:
349 return HasFieldMarshalTag.Field;
350 }
351 }
352
354 {
355 switch (kind)
356 {
357 case HandleKind.EventDefinition:
358 return HasSemanticsTag.Event;
359 case HandleKind.PropertyDefinition:
360 return HasSemanticsTag.Property;
361 default:
363 return HasSemanticsTag.Event;
364 }
365 }
366
368 {
369 switch (kind)
370 {
371 case HandleKind.AssemblyFile:
372 return ImplementationTag.File;
373 case HandleKind.AssemblyReference:
374 return ImplementationTag.AssemblyRef;
375 case HandleKind.ExportedType:
376 return ImplementationTag.ExportedType;
377 default:
379 return ImplementationTag.File;
380 }
381 }
382
384 {
385 switch (kind)
386 {
387 case HandleKind.FieldDefinition:
388 return MemberForwardedTag.Field;
389 case HandleKind.MethodDefinition:
390 return MemberForwardedTag.MethodDef;
391 default:
393 return MemberForwardedTag.Field;
394 }
395 }
396
398 {
399 switch (kind)
400 {
401 case HandleKind.TypeDefinition:
402 return MemberRefParentTag.TypeDef;
403 case HandleKind.TypeReference:
404 return MemberRefParentTag.TypeRef;
405 case HandleKind.ModuleReference:
406 return MemberRefParentTag.ModuleRef;
407 case HandleKind.MethodDefinition:
408 return MemberRefParentTag.MethodDef;
409 case HandleKind.TypeSpecification:
410 return MemberRefParentTag.TypeSpec;
411 default:
413 return MemberRefParentTag.TypeDef;
414 }
415 }
416
418 {
419 switch (kind)
420 {
421 case HandleKind.MethodDefinition:
422 return MethodDefOrRefTag.MethodDef;
423 case HandleKind.MemberReference:
424 return MethodDefOrRefTag.MemberRef;
425 default:
427 return MethodDefOrRefTag.MethodDef;
428 }
429 }
430
432 {
433 switch (kind)
434 {
435 case HandleKind.TypeReference:
436 if (kind != HandleKind.TypeReference)
437 {
438 break;
439 }
440 return ResolutionScopeTag.TypeRef;
441 case HandleKind.ModuleDefinition:
442 return ResolutionScopeTag.Module;
443 case HandleKind.ModuleReference:
444 return ResolutionScopeTag.ModuleRef;
445 case HandleKind.AssemblyReference:
446 return ResolutionScopeTag.AssemblyRef;
447 }
449 return ResolutionScopeTag.Module;
450 }
451
453 {
454 switch (kind)
455 {
456 case HandleKind.TypeDefinition:
457 return TypeDefOrRefOrSpecTag.TypeDef;
458 case HandleKind.TypeReference:
459 return TypeDefOrRefOrSpecTag.TypeRef;
460 case HandleKind.TypeSpecification:
461 return TypeDefOrRefOrSpecTag.TypeSpec;
462 default:
464 return TypeDefOrRefOrSpecTag.TypeDef;
465 }
466 }
467
469 {
470 switch (kind)
471 {
472 case HandleKind.TypeDefinition:
473 return TypeDefOrRefTag.TypeDef;
474 case HandleKind.TypeReference:
475 return TypeDefOrRefTag.TypeRef;
476 default:
478 return TypeDefOrRefTag.TypeDef;
479 }
480 }
481
483 {
484 switch (kind)
485 {
486 case HandleKind.TypeDefinition:
487 return TypeOrMethodDefTag.TypeDef;
488 case HandleKind.MethodDefinition:
489 return TypeOrMethodDefTag.MethodDef;
490 default:
492 return TypeOrMethodDefTag.TypeDef;
493 }
494 }
495
497 {
498 switch (kind)
499 {
500 case HandleKind.MethodDefinition:
501 return HasCustomDebugInformationTag.MethodDef;
502 case HandleKind.FieldDefinition:
503 return HasCustomDebugInformationTag.Field;
504 case HandleKind.TypeReference:
505 return HasCustomDebugInformationTag.TypeRef;
506 case HandleKind.TypeDefinition:
507 return HasCustomDebugInformationTag.TypeDef;
508 case HandleKind.Parameter:
509 return HasCustomDebugInformationTag.Param;
510 case HandleKind.InterfaceImplementation:
511 return HasCustomDebugInformationTag.InterfaceImpl;
512 case HandleKind.MemberReference:
513 return HasCustomDebugInformationTag.MemberRef;
514 case HandleKind.ModuleDefinition:
515 return HasCustomDebugInformationTag.Module;
516 case HandleKind.DeclarativeSecurityAttribute:
517 return HasCustomDebugInformationTag.DeclSecurity;
518 case HandleKind.PropertyDefinition:
519 return HasCustomDebugInformationTag.Property;
520 case HandleKind.EventDefinition:
521 return HasCustomDebugInformationTag.Event;
522 case HandleKind.StandaloneSignature:
523 return HasCustomDebugInformationTag.StandAloneSig;
524 case HandleKind.ModuleReference:
525 return HasCustomDebugInformationTag.ModuleRef;
526 case HandleKind.TypeSpecification:
527 return HasCustomDebugInformationTag.TypeSpec;
528 case HandleKind.AssemblyDefinition:
529 return HasCustomDebugInformationTag.Assembly;
530 case HandleKind.AssemblyReference:
531 return HasCustomDebugInformationTag.AssemblyRef;
532 case HandleKind.AssemblyFile:
534 case HandleKind.ExportedType:
535 return HasCustomDebugInformationTag.ExportedType;
536 case HandleKind.ManifestResource:
537 return HasCustomDebugInformationTag.ManifestResource;
538 case HandleKind.GenericParameter:
539 return HasCustomDebugInformationTag.GenericParam;
540 case HandleKind.GenericParameterConstraint:
541 return HasCustomDebugInformationTag.GenericParamConstraint;
542 case HandleKind.MethodSpecification:
543 return HasCustomDebugInformationTag.MethodSpec;
544 case HandleKind.Document:
545 return HasCustomDebugInformationTag.Document;
546 case HandleKind.LocalScope:
547 return HasCustomDebugInformationTag.LocalScope;
548 case HandleKind.LocalVariable:
549 return HasCustomDebugInformationTag.LocalVariable;
550 case HandleKind.LocalConstant:
551 return HasCustomDebugInformationTag.LocalConstant;
552 case HandleKind.ImportScope:
553 return HasCustomDebugInformationTag.ImportScope;
554 default:
556 return HasCustomDebugInformationTag.MethodDef;
557 }
558 }
559}
static int ResolutionScope(EntityHandle handle)
static TypeOrMethodDefTag ToTypeOrMethodDefTag(HandleKind kind)
static int HasFieldMarshal(EntityHandle handle)
static int TypeOrMethodDef(EntityHandle handle)
static MethodDefOrRefTag ToMethodDefOrRefTag(HandleKind kind)
static MemberRefParentTag ToMemberRefParentTag(HandleKind kind)
static HasFieldMarshalTag ToHasFieldMarshalTag(HandleKind kind)
static int TypeDefOrRef(EntityHandle handle)
static int HasConstant(EntityHandle handle)
static CustomAttributeTypeTag ToCustomAttributeTypeTag(HandleKind kind)
static int TypeDefOrRefOrSpec(EntityHandle handle)
static int MemberForwarded(EntityHandle handle)
static HasSemanticsTag ToHasSemanticsTag(HandleKind kind)
static TypeDefOrRefTag ToTypeDefOrRefTag(HandleKind kind)
static int CustomAttributeType(EntityHandle handle)
static ImplementationTag ToImplementationTag(HandleKind kind)
static HasConstantTag ToHasConstantTag(HandleKind kind)
static int HasDeclSecurity(EntityHandle handle)
static HasDeclSecurityTag ToHasDeclSecurityTag(HandleKind kind)
static int HasCustomAttribute(EntityHandle handle)
static MemberForwardedTag ToMemberForwardedTag(HandleKind kind)
static HasCustomDebugInformationTag ToHasCustomDebugInformationTag(HandleKind kind)
static TypeDefOrRefOrSpecTag ToTypeDefOrRefOrSpecTag(HandleKind kind)
static int MethodDefOrRef(EntityHandle handle)
static int HasSemantics(EntityHandle handle)
static ResolutionScopeTag ToResolutionScopeTag(HandleKind kind)
static int Implementation(EntityHandle handle)
static int HasCustomDebugInformation(EntityHandle handle)
static HasCustomAttributeTag ToHasCustomAttributeTag(HandleKind kind)
static int MemberRefParent(EntityHandle handle)
static Exception InvalidArgument_UnexpectedHandleKind(HandleKind kind)
Definition Throw.cs:33