public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            Interface9 interface2 = Class163.smethod_5 <Interface9>(value);
            Type       type       = (interface2.Object_0 != null) ? interface2.Object_0.GetType() : null;

            writer.WriteStartObject();
            writer.WritePropertyName("Key");
            writer.WriteValue(interface2.String_0);
            writer.WritePropertyName("Type");
            writer.WriteValue((type != null) ? type.FullName : null);
            writer.WritePropertyName("Value");
            if (type != null)
            {
                string str;
                if (Class137.smethod_0(interface2.Object_0, type, out str))
                {
                    writer.WriteValue(str);
                }
                else
                {
                    writer.WriteValue(interface2.Object_0);
                }
            }
            else
            {
                writer.WriteNull();
            }
            writer.WriteEndObject();
        }
示例#2
0
        public Class134(Class144 class1440, Class140 class1401, Class136 class1360, int int4, int int5,
                        int int6) : base(class1401, int5)
        {
            _int3 = class1360.vmethod_2();
            _int1 = int6;
            for (var i = 0; i < int6; i++)
            {
                _int2[i] = class1440.vmethod_12(int4);
            }
            var num  = class1440.vmethod_10(2);
            var num2 = num;

            if (num2 == 0)
            {
                var int7   = class1440.vmethod_10(4);
                var @class = new Class138();
                _class1370       = @class;
                @class.Int0      = int7;
                @class.Class1430 = class1360.vmethod_1();
                @class.vmethod_0(class1440, int6, @class.Int0, class1401, class1360.vmethod_2());
                Buffer.BlockCopy(_int2, 0, class1360.vmethod_0(), 0, int6 << 2);
                BlackMagic.CopyArrayOffset(_int3, class1401.Int0 - int6, int6, class1360.vmethod_0(), int6);
                return;
            }
            throw new IOException("STREAM_DECODER_UNPARSEABLE_STREAM");
        }
 private Class137 xrxcLalgu3(Type type_0)
 {
     lock (this.YkdcNurUyP)
     {
         if (this.YkdcNurUyP.ContainsKey(type_0))
         {
             return(this.YkdcNurUyP[type_0]);
         }
         IPropertyQuicker    quicker = PropertyQuickerFactory.CreatePropertyQuicker(type_0);
         List <PropertyInfo> list    = new List <PropertyInfo>();
         foreach (PropertyInfo info in type_0.GetProperties())
         {
             if ((info.CanRead && info.CanWrite) && (info.GetCustomAttributes(typeof(NotSerializedCompactlyAttribute), true).Length <= 0))
             {
                 list.Add(info);
             }
         }
         if (comparison_0 == null)
         {
             comparison_0 = new Comparison <PropertyInfo>(CompactPropertySerializer.smethod_0);
         }
         list.Sort(comparison_0);
         Class137 class2 = new Class137(quicker, list.ToArray());
         this.YkdcNurUyP.Add(type_0, class2);
         return(class2);
     }
 }
示例#4
0
 public Class134(Class144 class144_0, Class140 class140_1, Class136 class136_0, int int_4, int int_5, int int_6)
     : base(class140_1, int_5)
 {
     this.int_3 = class136_0.vmethod_2();
     this.int_1 = int_6;
     for (int i = 0; i < int_6; i++)
     {
         this.int_2[i] = class144_0.vmethod_12(int_4);
     }
     int num = class144_0.vmethod_10(2);
     int num2 = num;
     if (num2 == 0)
     {
         int int_7 = class144_0.vmethod_10(4);
         Class138 @class = new Class138();
         this.class137_0 = @class;
         @class.int_0 = int_7;
         @class.class143_0 = class136_0.vmethod_1();
         @class.vmethod_0(class144_0, int_6, @class.int_0, class140_1, class136_0.vmethod_2());
         Buffer.BlockCopy(this.int_2, 0, class136_0.vmethod_0(), 0, int_6 << 2);
         BlackMagic.CopyArrayOffset(this.int_3, class140_1.int_0 - int_6, int_6, class136_0.vmethod_0(), int_6);
         return;
     }
     throw new IOException("STREAM_DECODER_UNPARSEABLE_STREAM");
 }
示例#5
0
        public Class134(Class144 class144_0, Class140 class140_1, Class136 class136_0, int int_4, int int_5, int int_6) : base(class140_1, int_5)
        {
            this.int_3 = class136_0.vmethod_2();
            this.int_1 = int_6;
            for (int i = 0; i < int_6; i++)
            {
                this.int_2[i] = class144_0.vmethod_12(int_4);
            }
            int num  = class144_0.vmethod_10(2);
            int num2 = num;

            if (num2 == 0)
            {
                int      int_7  = class144_0.vmethod_10(4);
                Class138 @class = new Class138();
                this.class137_0   = @class;
                @class.int_0      = int_7;
                @class.class143_0 = class136_0.vmethod_1();
                @class.vmethod_0(class144_0, int_6, @class.int_0, class140_1, class136_0.vmethod_2());
                Buffer.BlockCopy(this.int_2, 0, class136_0.vmethod_0(), 0, int_6 << 2);
                BlackMagic.CopyArrayOffset(this.int_3, class140_1.int_0 - int_6, int_6, class136_0.vmethod_0(), int_6);
                return;
            }
            throw new IOException("STREAM_DECODER_UNPARSEABLE_STREAM");
        }
 public void GetFromat(string fieldName, Type type, ref int startOffet, StringBuilder offsetBuilder, StringBuilder formats)
 {
     if (ByteConverter.SupportType(type))
     {
         object obj2   = Activator.CreateInstance(type);
         byte[] buffer = ByteConverter.ToBytes(type, obj2);
         formats.Append(string.Format("FieldName:{0,-20} ;", fieldName));
         formats.Append(string.Format("Type:{0,-20} ;", TypeHelper.GetClassSimpleName(type)));
         formats.Append(string.Format("StartOffet:{0,-20} ;", ((int)startOffet).ToString() + offsetBuilder.ToString()));
         formats.Append(string.Format("Length:{0,-20} ;", buffer.Length));
         formats.Append("\n");
         startOffet += buffer.Length;
     }
     else if (type == typeof(string))
     {
         formats.Append(string.Format("FieldName:{0,-20} ;", fieldName + "Len"));
         formats.Append(string.Format("Type:{0,-20} ;", "int"));
         formats.Append(string.Format("StartOffet:{0,-20} ;", ((int)startOffet).ToString() + offsetBuilder.ToString()));
         formats.Append(string.Format("Length:{0,-20} ;", 4));
         formats.Append("\n");
         startOffet += 4;
         formats.Append(string.Format("FieldName:{0,-20} ;", fieldName));
         formats.Append(string.Format("Type:{0,-20} ;", TypeHelper.GetClassSimpleName(type)));
         formats.Append(string.Format("StartOffet:{0,-20} ;", ((int)startOffet).ToString() + offsetBuilder.ToString()));
         formats.Append(string.Format("Length:{0,-20} ;", fieldName + "Len"));
         formats.Append("\n");
         offsetBuilder.Append(string.Format("+{0}Len", fieldName));
     }
     else if (type == typeof(byte[]))
     {
         formats.Append(string.Format("FieldName:{0,-20} ;", fieldName + "Len"));
         formats.Append(string.Format("Type:{0,-20} ;", "int"));
         formats.Append(string.Format("StartOffet:{0,-20} ;", ((int)startOffet).ToString() + offsetBuilder.ToString()));
         formats.Append(string.Format("Length:{0,-20} ;", 4));
         formats.Append("\n");
         startOffet += 4;
         formats.Append(string.Format("FieldName:{0,-20} ;", fieldName));
         formats.Append(string.Format("Type:{0,-20} ;", TypeHelper.GetClassSimpleName(type)));
         formats.Append(string.Format("StartOffet:{0,-20} ;", ((int)startOffet).ToString() + offsetBuilder.ToString()));
         formats.Append(string.Format("Length:{0,-20} ;", fieldName + "Len"));
         formats.Append("\n");
         offsetBuilder.Append(string.Format("+{0}Len", fieldName));
     }
     else if (((!type.IsGenericType || ((type.GetGenericTypeDefinition() != typeof(IList <>)) && (type.GetGenericTypeDefinition() != typeof(List <>)))) && (!type.IsGenericType || ((type.GetGenericTypeDefinition() != typeof(IDictionary <,>)) && (type.GetGenericTypeDefinition() != typeof(Dictionary <,>))))) && (!type.IsGenericType && !type.IsArray))
     {
         string classSimpleName = TypeHelper.GetClassSimpleName(type);
         formats.Append(string.Format("FieldName:{0,-20} ;", classSimpleName + "Len"));
         formats.Append(string.Format("Type:{0,-20} ;", "int"));
         formats.Append(string.Format("StartOffet:{0,-20} ;", ((int)startOffet).ToString() + offsetBuilder.ToString()));
         formats.Append(string.Format("Length:{0,-20} ;", 4));
         formats.Append("\n");
         startOffet += 4;
         Class137 class2 = this.xrxcLalgu3(type);
         for (int i = 0; i < class2.method_1().Length; i++)
         {
             this.GetFromat(class2.method_1()[i].Name, class2.method_1()[i].PropertyType, ref startOffet, offsetBuilder, formats);
         }
     }
 }
示例#7
0
    // Token: 0x06000B44 RID: 2884 RVA: 0x0003AC0C File Offset: 0x00038E0C
    public Class137 method_1(Class137 class137_1, JsonSchema jsonSchema_0)
    {
        string key;

        if (class137_1 != null)
        {
            if (class137_1.method_1().Contains(jsonSchema_0))
            {
                return(class137_1);
            }
            key = Class137.smethod_0(class137_1.method_1().Union(new JsonSchema[]
            {
                jsonSchema_0
            }));
        }
        else
        {
            key = Class137.smethod_0(new JsonSchema[]
            {
                jsonSchema_0
            });
        }
        if (this.class139_0.Contains(key))
        {
            return(this.class139_0[key]);
        }
        Class137 @class = (class137_1 != null) ? class137_1.method_9(jsonSchema_0) : new Class137(jsonSchema_0);

        this.class139_0.Add(@class);
        this.method_2(jsonSchema_0.Properties, @class.method_2());
        this.method_2(jsonSchema_0.PatternProperties, @class.method_3());
        if (jsonSchema_0.Items != null)
        {
            for (int i = 0; i < jsonSchema_0.Items.Count; i++)
            {
                this.method_4(@class, i, jsonSchema_0.Items[i]);
            }
        }
        if (jsonSchema_0.AdditionalItems != null)
        {
            this.method_6(@class, jsonSchema_0.AdditionalItems);
        }
        if (jsonSchema_0.AdditionalProperties != null)
        {
            this.method_5(@class, jsonSchema_0.AdditionalProperties);
        }
        if (jsonSchema_0.Extends != null)
        {
            foreach (JsonSchema jsonSchema_ in jsonSchema_0.Extends)
            {
                @class = this.method_1(@class, jsonSchema_);
            }
        }
        return(@class);
    }
示例#8
0
    // Token: 0x06000B47 RID: 2887 RVA: 0x0003ADE8 File Offset: 0x00038FE8
    public void method_4(Class137 class137_1, int int_0, JsonSchema jsonSchema_0)
    {
        Class137 class137_2 = (class137_1.method_4().Count > int_0) ? class137_1.method_4()[int_0] : null;
        Class137 @class     = this.method_1(class137_2, jsonSchema_0);

        if (class137_1.method_4().Count <= int_0)
        {
            class137_1.method_4().Add(@class);
            return;
        }
        class137_1.method_4()[int_0] = @class;
    }
示例#9
0
        public Class135(Class144 class1440, Class140 class1401, Class136 class1360, int int7, int int8,
                        int int9) : base(class1401, int8)
        {
            _int6 = class1360.vmethod_2();
            _int1 = int9;
            for (var i = 0; i < int9; i++)
            {
                _int5[i] = class1440.vmethod_12(int7);
            }
            var num = class1440.vmethod_10(4);

            if (num == 15)
            {
                throw new IOException("STREAM_DECODER_ERROR_STATUS_LOST_SYNC");
            }
            _int2 = num + 1;
            _int3 = class1440.vmethod_12(5);
            for (var j = 0; j < int9; j++)
            {
                _int4[j] = class1440.vmethod_12(_int2);
            }
            var num2 = class1440.vmethod_10(2);
            var num3 = num2;

            if (num3 != 0)
            {
                throw new IOException("STREAM_DECODER_UNPARSEABLE_STREAM");
            }
            _class1370 = new Class138();
            ((Class138)_class1370).Int0      = class1440.vmethod_10(4);
            ((Class138)_class1370).Class1430 = class1360.vmethod_1();
            if (_class1370 is Class138)
            {
                ((Class138)_class1370).vmethod_0(class1440, int9, ((Class138)_class1370).Int0, class1401,
                                                 class1360.vmethod_2());
            }
            Buffer.BlockCopy(_int5, 0, class1360.vmethod_0(), 0, int9 << 2);
            if (int7 + _int2 + Class141.smethod_0(int9) > 32)
            {
                Class130.smethod_1(class1360.vmethod_2(), class1401.Int0 - int9, _int4, int9, _int3,
                                   class1360.vmethod_0(), int9);
                return;
            }
            if (int7 <= 16 && _int2 <= 16)
            {
                Class130.smethod_0(class1360.vmethod_2(), class1401.Int0 - int9, _int4, int9, _int3,
                                   class1360.vmethod_0(), int9);
                return;
            }
            Class130.smethod_0(class1360.vmethod_2(), class1401.Int0 - int9, _int4, int9, _int3, class1360.vmethod_0(),
                               int9);
        }
示例#10
0
 // Token: 0x06000B55 RID: 2901 RVA: 0x0003AFF8 File Offset: 0x000391F8
 public Class137(JsonSchema jsonSchema_0)
 {
     Class202.ofdixO4zTbIfy();
     base..ctor();
     this.readOnlyCollection_0 = new ReadOnlyCollection <JsonSchema>(new JsonSchema[]
     {
         jsonSchema_0
     });
     this.dictionary_0 = new Dictionary <string, Class137>();
     this.dictionary_1 = new Dictionary <string, Class137>();
     this.list_0       = new List <Class137>();
     this.string_0     = Class137.smethod_0(this.method_1());
 }
示例#11
0
 // Token: 0x06000B56 RID: 2902 RVA: 0x0003B058 File Offset: 0x00039258
 private Class137(Class137 class137_2, JsonSchema jsonSchema_0)
 {
     Class202.ofdixO4zTbIfy();
     base..ctor();
     this.readOnlyCollection_0 = new ReadOnlyCollection <JsonSchema>(class137_2.method_1().Union(new JsonSchema[]
     {
         jsonSchema_0
     }).ToList <JsonSchema>());
     this.dictionary_0 = new Dictionary <string, Class137>(class137_2.method_2());
     this.dictionary_1 = new Dictionary <string, Class137>(class137_2.method_3());
     this.list_0       = new List <Class137>(class137_2.method_4());
     this.method_6(class137_2.method_5());
     this.method_8(class137_2.method_7());
     this.string_0 = Class137.smethod_0(this.method_1());
 }
示例#12
0
        public Class135(Class144 class144_0, Class140 class140_1, Class136 class136_0, int int_7, int int_8, int int_9) : base(class140_1, int_8)
        {
            this.int_6 = class136_0.vmethod_2();
            this.int_1 = int_9;
            for (int i = 0; i < int_9; i++)
            {
                this.int_5[i] = class144_0.vmethod_12(int_7);
            }
            int num = class144_0.vmethod_10(4);

            if (num == 15)
            {
                throw new IOException("STREAM_DECODER_ERROR_STATUS_LOST_SYNC");
            }
            this.int_2 = num + 1;
            this.int_3 = class144_0.vmethod_12(5);
            for (int j = 0; j < int_9; j++)
            {
                this.int_4[j] = class144_0.vmethod_12(this.int_2);
            }
            int num2 = class144_0.vmethod_10(2);
            int num3 = num2;

            if (num3 != 0)
            {
                throw new IOException("STREAM_DECODER_UNPARSEABLE_STREAM");
            }
            this.class137_0 = new Class138();
            ((Class138)this.class137_0).int_0      = class144_0.vmethod_10(4);
            ((Class138)this.class137_0).class143_0 = class136_0.vmethod_1();
            if (this.class137_0 is Class138)
            {
                ((Class138)this.class137_0).vmethod_0(class144_0, int_9, ((Class138)this.class137_0).int_0, class140_1, class136_0.vmethod_2());
            }
            Buffer.BlockCopy(this.int_5, 0, class136_0.vmethod_0(), 0, int_9 << 2);
            if (int_7 + this.int_2 + Class141.smethod_0(int_9) > 32)
            {
                Class130.smethod_1(class136_0.vmethod_2(), class140_1.int_0 - int_9, this.int_4, int_9, this.int_3, class136_0.vmethod_0(), int_9);
                return;
            }
            if (int_7 <= 16 && this.int_2 <= 16)
            {
                Class130.smethod_0(class136_0.vmethod_2(), class140_1.int_0 - int_9, this.int_4, int_9, this.int_3, class136_0.vmethod_0(), int_9);
                return;
            }
            Class130.smethod_0(class136_0.vmethod_2(), class140_1.int_0 - int_9, this.int_4, int_9, this.int_3, class136_0.vmethod_0(), int_9);
        }
        protected override object DoDeserializeComplicatedType(Type type, byte[] buff, ref int offset)
        {
            int    num  = ByteConverter.Parse <int>(buff, ref offset);
            object obj2 = null;

            if (num > -1)
            {
                obj2 = Activator.CreateInstance(type);
                Class137 class2 = this.xrxcLalgu3(type);
                for (int i = 0; i < class2.method_1().Length; i++)
                {
                    object obj3 = base.DoDeserialize(class2.method_1()[i].PropertyType, buff, ref offset);
                    this.method_0(type, class2.method_0(), obj2, class2.method_1()[i].Name, obj3);
                }
            }
            return(obj2);
        }
示例#14
0
 public Class135(Class144 class144_0, Class140 class140_1, Class136 class136_0, int int_7, int int_8, int int_9)
     : base(class140_1, int_8)
 {
     this.int_6 = class136_0.vmethod_2();
     this.int_1 = int_9;
     for (int i = 0; i < int_9; i++)
     {
         this.int_5[i] = class144_0.vmethod_12(int_7);
     }
     int num = class144_0.vmethod_10(4);
     if (num == 15)
     {
         throw new IOException("STREAM_DECODER_ERROR_STATUS_LOST_SYNC");
     }
     this.int_2 = num + 1;
     this.int_3 = class144_0.vmethod_12(5);
     for (int j = 0; j < int_9; j++)
     {
         this.int_4[j] = class144_0.vmethod_12(this.int_2);
     }
     int num2 = class144_0.vmethod_10(2);
     int num3 = num2;
     if (num3 != 0)
     {
         throw new IOException("STREAM_DECODER_UNPARSEABLE_STREAM");
     }
     this.class137_0 = new Class138();
     ((Class138)this.class137_0).int_0 = class144_0.vmethod_10(4);
     ((Class138)this.class137_0).class143_0 = class136_0.vmethod_1();
     if (this.class137_0 is Class138)
     {
         ((Class138)this.class137_0).vmethod_0(class144_0, int_9, ((Class138)this.class137_0).int_0, class140_1, class136_0.vmethod_2());
     }
     Buffer.BlockCopy(this.int_5, 0, class136_0.vmethod_0(), 0, int_9 << 2);
     if (int_7 + this.int_2 + Class141.smethod_0(int_9) > 32)
     {
         Class130.smethod_1(class136_0.vmethod_2(), class140_1.int_0 - int_9, this.int_4, int_9, this.int_3, class136_0.vmethod_0(), int_9);
         return;
     }
     if (int_7 <= 16 && this.int_2 <= 16)
     {
         Class130.smethod_0(class136_0.vmethod_2(), class140_1.int_0 - int_9, this.int_4, int_9, this.int_3, class136_0.vmethod_0(), int_9);
         return;
     }
     Class130.smethod_0(class136_0.vmethod_2(), class140_1.int_0 - int_9, this.int_4, int_9, this.int_3, class136_0.vmethod_0(), int_9);
 }
示例#15
0
    // Token: 0x06000B4A RID: 2890 RVA: 0x0003AE44 File Offset: 0x00039044
    private Class135 method_7(Class137 class137_1)
    {
        Class135 @class;

        if (this.dictionary_0.TryGetValue(class137_1, out @class))
        {
            return(@class);
        }
        @class = Class135.Create(class137_1.method_1());
        this.dictionary_0[class137_1] = @class;
        foreach (KeyValuePair <string, Class137> keyValuePair in class137_1.method_2())
        {
            if (@class.method_24() == null)
            {
                @class.method_25(new Dictionary <string, Class135>());
            }
            @class.method_24()[keyValuePair.Key] = this.method_7(keyValuePair.Value);
        }
        foreach (KeyValuePair <string, Class137> keyValuePair2 in class137_1.method_3())
        {
            if (@class.method_26() == null)
            {
                @class.method_27(new Dictionary <string, Class135>());
            }
            @class.method_26()[keyValuePair2.Key] = this.method_7(keyValuePair2.Value);
        }
        foreach (Class137 class137_2 in class137_1.method_4())
        {
            if (@class.method_22() == null)
            {
                @class.method_23(new List <Class135>());
            }
            @class.method_22().Add(this.method_7(class137_2));
        }
        if (class137_1.method_5() != null)
        {
            @class.method_29(this.method_7(class137_1.method_5()));
        }
        if (class137_1.method_7() != null)
        {
            @class.method_31(this.method_7(class137_1.method_7()));
        }
        return(@class);
    }
 protected override void DoSerializeComplicatedType(Type type, object obj, MemoryStream stream)
 {
     if (obj == null)
     {
         byte[] buffer3 = ByteConverter.ToBytes <int>(-1);
         stream.Write(buffer3, 0, buffer3.Length);
     }
     else
     {
         Class137     class2  = this.xrxcLalgu3(type);
         MemoryStream stream2 = new MemoryStream();
         for (int i = 0; i < class2.method_1().Length; i++)
         {
             object obj2 = class2.method_0().GetValue(obj, class2.method_1()[i].Name);
             base.DoSerialize(stream2, class2.method_1()[i].PropertyType, obj2);
         }
         byte[] buffer  = stream2.ToArray();
         byte[] buffer2 = ByteConverter.ToBytes <int>(buffer.Length);
         stream.Write(buffer2, 0, buffer2.Length);
         stream.Write(buffer, 0, buffer.Length);
     }
 }
示例#17
0
 public void method_8(Class137 class137_2)
 {
     this.class137_1 = class137_2;
 }
示例#18
0
 public void method_6(Class137 class137_2)
 {
     this.class137_0 = class137_2;
 }
 public override void Visit(Class137 c) { }
示例#20
0
 // Token: 0x06000B49 RID: 2889 RVA: 0x0000A8B4 File Offset: 0x00008AB4
 public void method_6(Class137 class137_1, JsonSchema jsonSchema_0)
 {
     class137_1.method_8(this.method_1(class137_1.method_7(), jsonSchema_0));
 }
 public abstract void Visit(Class137 c);