terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
EnumConverter.cs
Go to the documentation of this file.
1using System;
5
7{
8 // Token: 0x020003E2 RID: 994
10 {
11 // Token: 0x06001A41 RID: 6721 RVA: 0x000489D0 File Offset: 0x00046BD0
13 {
15 }
16
17 // Token: 0x17000607 RID: 1543
18 // (get) Token: 0x06001A42 RID: 6722 RVA: 0x000489EC File Offset: 0x00046BEC
19 protected Type EnumType
20 {
21 get
22 {
23 return this.type;
24 }
25 }
26
27 // Token: 0x17000608 RID: 1544
28 // (get) Token: 0x06001A43 RID: 6723 RVA: 0x00048A00 File Offset: 0x00046C00
29 // (set) Token: 0x06001A44 RID: 6724 RVA: 0x00048A14 File Offset: 0x00046C14
31 {
32 get
33 {
34 return this.values;
35 }
36 set
37 {
39 }
40 }
41
42 // Token: 0x06001A45 RID: 6725 RVA: 0x00048A28 File Offset: 0x00046C28
43 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
44 {
45 if (!true)
46 {
47 }
48 Type type;
49 bool flag = sourceType == type;
50 Type type2;
51 bool flag2 = sourceType == type2;
52 return true;
53 }
54
55 // Token: 0x06001A46 RID: 6726 RVA: 0x00048A4C File Offset: 0x00046C4C
57 {
58 if (!true)
59 {
60 }
61 Type type;
62 bool flag = destinationType == type;
63 Type type2;
64 bool flag2 = destinationType == type2;
65 return true;
66 }
67
68 // Token: 0x17000609 RID: 1545
69 // (get) Token: 0x06001A47 RID: 6727 RVA: 0x00048A70 File Offset: 0x00046C70
70 protected virtual IComparer Comparer
71 {
72 get
73 {
74 if (!true)
75 {
76 }
77 return 1;
78 }
79 }
80
81 // Token: 0x06001A48 RID: 6728 RVA: 0x00048A84 File Offset: 0x00046C84
82 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
83 {
84 if (value != null)
85 {
86 }
87 if (value == null)
88 {
89 object obj;
90 return obj;
91 }
92 if (value != null && value == null)
93 {
94 throw new InvalidCastException();
95 }
96 string[] array;
97 long num = Convert.ToInt64(array, culture);
98 object obj2;
99 return obj2;
100 }
101
102 // Token: 0x06001A49 RID: 6729 RVA: 0x00048B24 File Offset: 0x00046D24
104 {
105 if (!true)
106 {
107 }
108 Type type;
109 bool flag = type == type;
110 if (value != null)
111 {
113 Type type2;
115 if (value != null)
116 {
117 bool flag2 = value.GetType() != underlyingType;
118 if (value == null)
119 {
120 throw new InvalidCastException();
121 }
122 if (value != null)
123 {
124 return value;
125 }
126 goto IL_012C;
127 }
128 else if ((type2 != null && type2 == null) || (fieldInfo != null && fieldInfo == null) || (value != null && value == null))
129 {
130 throw new ArrayTypeMismatchException();
131 }
132 }
133 else
134 {
136 Type type3;
137 bool flag3 = underlyingType == type3;
138 if (value != null)
139 {
140 Type type4 = this.type;
141 int num = 44;
142 string text;
143 int num2 = text.IndexOf((char)num);
145 if (value != null)
146 {
147 if (value == null)
148 {
149 goto IL_012C;
150 }
151 if (value != null)
152 {
153 return value;
154 }
155 throw new InvalidCastException();
156 }
157 }
158 }
159 Array array;
160 int length = array.Length;
161 int length2 = array.Length;
162 long num3 = 0L;
163 object value2 = array.GetValue((int)num3);
164 if (value2 == null)
165 {
166 return value2;
167 }
168 int length3 = array.Length;
169 int num4 = 1;
170 long num5;
171 while (num5 != 0L)
172 {
173 }
174 if (num4 == 0)
175 {
176 }
177 object obj;
178 if (obj != null)
179 {
180 }
181 return obj;
182 IL_012C:
183 throw new InvalidCastException();
184 }
185
186 // Token: 0x06001A4A RID: 6730 RVA: 0x00048C74 File Offset: 0x00046E74
188 {
189 if (this.values == null)
190 {
192 Type type = this.type;
193 if (type != null)
194 {
195 long num = 0L;
196 Type type2;
197 if (type2 != null)
198 {
199 }
200 if ((!false || num != 0L) && type2 != null)
201 {
202 Type type3 = this.type;
203 if (num == 0L)
204 {
205 }
206 object obj;
207 if (obj != null)
208 {
209 }
210 }
211 }
212 if (this != null)
213 {
214 }
215 }
216 throw new InvalidCastException();
217 }
218
219 // Token: 0x06001A4B RID: 6731 RVA: 0x00048CD4 File Offset: 0x00046ED4
221 {
222 /*
223An exception occurred when decompiling this method (06001A4B)
224
225ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean System.ComponentModel.EnumConverter::GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext)
226
227 ---> System.Exception: Basic block has to end with unconditional control flow.
228{
229 IL_0000:
230 stloc:Type(var_0_06, ldfld:Type(EnumConverter::type, ldloc:EnumConverter(this)))
231 brtrue(IL_0000, ldc.i4:bool(1))
232}
233
234 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
235 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
236 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
237 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
238 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
239 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
240 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
241 --- End of inner exception stack trace ---
242 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
243 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
244*/;
245 }
246
247 // Token: 0x06001A4C RID: 6732 RVA: 0x00048CEC File Offset: 0x00046EEC
249 {
250 return true;
251 }
252
253 // Token: 0x06001A4D RID: 6733 RVA: 0x00048CFC File Offset: 0x00046EFC
254 public override bool IsValid(ITypeDescriptorContext context, object value)
255 {
256 Type type = this.type;
257 if (!true)
258 {
259 }
260 return Enum.IsDefined(type, value);
261 }
262
263 // Token: 0x04001309 RID: 4873
265
266 // Token: 0x0400130A RID: 4874
267 private Type type;
268 }
269}
class f__AnonymousType0<< Count > j__TPar
override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
override bool IsValid(ITypeDescriptorContext context, object value)
TypeConverter.StandardValuesCollection values
TypeConverter.StandardValuesCollection Values
override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
override bool GetStandardValuesSupported(ITypeDescriptorContext context)
static Type GetReflectionType(Type type)
static long ToInt64(object value)
Definition Convert.cs:1776
static Type GetUnderlyingType(Type enumType)
Definition Enum.cs:205
static bool IsDefined(Type enumType, object value)
Definition Enum.cs:351