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
BinaryConverter.cs
Go to the documentation of this file.
1using System;
6
8{
9 // Token: 0x020000F6 RID: 246
10 [Preserve]
12 {
13 // Token: 0x060009FE RID: 2558 RVA: 0x00018948 File Offset: 0x00016B48
14 public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
15 {
16 if (value != null)
17 {
18 byte[] byteArray = this.GetByteArray(value);
19 return;
20 }
21 }
22
23 // Token: 0x060009FF RID: 2559 RVA: 0x00018964 File Offset: 0x00016B64
24 private byte[] GetByteArray(object value)
25 {
26 bool flag = value.GetType().AssignableToTypeName("System.Data.Linq.Binary");
27 Type type = value.GetType();
28 this.EnsureReflectionObject(type);
29 object value2 = this._reflectionObject.GetValue(value, "ToArray");
30 if (value2 == null || value2 != null)
31 {
34 string text = "Unexpected value type when writing binary: {0}".FormatWith(invariantCulture, type2);
35 }
36 throw new InvalidCastException();
37 }
38
39 // Token: 0x06000A00 RID: 2560 RVA: 0x000189D0 File Offset: 0x00016BD0
41 {
42 if (this._reflectionObject == null)
43 {
44 Type type;
45 if ((type != null && type == null) || ("ToArray" != null && "ToArray" == null))
46 {
48 }
51 }
52 }
53
54 // Token: 0x06000A01 RID: 2561 RVA: 0x00018A08 File Offset: 0x00016C08
55 public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
56 {
57 bool flag = ReflectionUtils.IsNullable(objectType);
58 bool flag2 = ReflectionUtils.IsNullableType(objectType);
60 bool flag3 = underlyingType.AssignableToTypeName("System.Data.Linq.Binary");
61 this.EnsureReflectionObject(underlyingType);
62 ObjectConstructor<object> <Creator>k__BackingField = this._reflectionObject.<Creator>k__BackingField;
63 byte[] array;
64 if (array == null || array != null)
65 {
67 return "Cannot convert null value to {0}.";
68 }
70 }
71
72 // Token: 0x06000A02 RID: 2562 RVA: 0x00018A88 File Offset: 0x00016C88
78
79 // Token: 0x06000A03 RID: 2563 RVA: 0x00018ABC File Offset: 0x00016CBC
80 public override bool CanConvert(Type objectType)
81 {
82 return objectType.AssignableToTypeName("System.Data.Linq.Binary");
83 }
84
85 // Token: 0x06000A04 RID: 2564 RVA: 0x00018AD4 File Offset: 0x00016CD4
87 {
88 }
89
90 // Token: 0x040003F2 RID: 1010
91 private const string BinaryTypeName = "System.Data.Linq.Binary";
92
93 // Token: 0x040003F3 RID: 1011
94 private const string BinaryToArrayName = "ToArray";
95
96 // Token: 0x040003F4 RID: 1012
98 }
99}
class f__AnonymousType0<< Count > j__TPar
override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
override bool CanConvert(Type objectType)
object GetValue(object target, string member)
static byte ToByte(object value, IFormatProvider provider)
Definition Convert.cs:737
static CultureInfo InvariantCulture
static Type GetUnderlyingType(Type nullableType)
Definition Nullable.2.cs:9
new Type GetType()
Definition Type.cs:287