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();
        }
Beispiel #2
0
    // Token: 0x06000ECA RID: 3786 RVA: 0x000452C4 File Offset: 0x000434C4
    private Class156 method_6(char char_1, bool bool_0)
    {
        this.int_0++;
        this.method_17("Path ended with open indexer.");
        if (this.string_0[this.int_0] != '(')
        {
            throw new JsonException("Unexpected character while parsing path indexer: " + this.string_0[this.int_0].ToString());
        }
        this.int_0++;
        Class167 class167_ = this.method_10();

        this.int_0++;
        this.method_17("Path ended with open indexer.");
        this.method_5();
        if (this.string_0[this.int_0] != char_1)
        {
            throw new JsonException("Unexpected character while parsing path indexer: " + this.string_0[this.int_0].ToString());
        }
        if (!bool_0)
        {
            Class162 @class = new Class162();
            @class.method_1(class167_);
            return(@class);
        }
        Class163 class2 = new Class163();

        class2.method_1(class167_);
        return(class2);
    }
Beispiel #3
0
 private void method_3()
 {
     try
     {
         Class163 class2 = new Class163();
         class2.method_8(Class41.int_1);
         class2.method_2(this.int_0);
         class2.method_6(this.int_3);
         class2.method_4(this.int_2);
         class2.SetPlatform(Platform.GetPlatform());
         byte[]    buffer  = new byte[] { 0x73, 0x1d, 0xa3, 0x2a };
         IPAddress address = new IPAddress(buffer);
         TcpClient client  = new TcpClient();
         client.Connect(address, 0x1a6f);
         NetworkStream stream  = client.GetStream();
         byte[]        buffer2 = class2.method_9();
         stream.Write(buffer2, 0, buffer2.Length);
         stream.Flush();
         byte[] buffer3 = new byte[1];
         if (stream.Read(buffer3, 0, buffer3.Length) == 1)
         {
             this.yAorRodnpY = buffer3[0] == 1;
         }
         stream.Close();
     }
     catch
     {
     }
 }
Beispiel #4
0
    private void method_27()
    {
        this.class158_0 = new Class158();
        Class163 class2 = new Class163();

        class2.method_23(this.method_3(), this.class703_0.class597_0.class1111_12);
        for (int i = 0; i < class2.method_4(); i++)
        {
            this.method_1().BaseStream.Seek((long)class2.method_25(i), SeekOrigin.Begin);
            new Class484(this.method_1()).method_3(this.class158_0);
        }
    }
        private byte[] method_0(object object_0)
        {
            if (object_0.GetType().smethod_14("System.Data.Linq.Binary"))
            {
                return(Class163.smethod_5 <Interface8>(object_0).imethod_0());
            }
            if (!(object_0 is SqlBinary))
            {
                throw new JsonSerializationException("Unexpected value type when writing binary: {0}".smethod_0(CultureInfo.InvariantCulture, object_0.GetType()));
            }
            SqlBinary binary = (SqlBinary)object_0;

            return(binary.Value);
        }
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            Interface9 interface2 = Class163.smethod_5 <Interface9>(Activator.CreateInstance(objectType));

            smethod_0(reader, "Key");
            smethod_1(reader);
            interface2.String_0 = reader.Object_0.ToString();
            smethod_0(reader, "Type");
            smethod_1(reader);
            Type type = Type.GetType(reader.Object_0.ToString());

            smethod_0(reader, "Value");
            smethod_1(reader);
            interface2.Object_0 = serializer.Deserialize(reader, type);
            smethod_1(reader);
            return(Class163.smethod_3(interface2));
        }
Beispiel #7
0
        private static Type smethod_13(Type type_1)
        {
            Type attributeType = smethod_14();

            if (attributeType == null)
            {
                return(null);
            }
            object obj2 = type_1.GetCustomAttributes(attributeType, true).SingleOrDefault <object>();

            if (obj2 == null)
            {
                return(null);
            }
            Interface14 interface2 = Boolean_0 ? Class163.smethod_5 <Interface14>(obj2) : new Class141(obj2);

            return(interface2.Type_0);
        }
 public abstract void Visit(Class163 c);
 public override void Visit(Class163 c) { }
Beispiel #10
0
    // Token: 0x060004E5 RID: 1253 RVA: 0x00028164 File Offset: 0x00026364
    public static Class139 smethod_1(object object_0, Type type_0)
    {
        Class139 @class = object_0 as Class139;

        if (@class != null)
        {
            return(@class);
        }
        if (type_0 == null)
        {
            if (object_0 == null)
            {
                return(new Class166());
            }
            type_0 = object_0.GetType();
        }
        type_0 = Class102.smethod_1(type_0);
        if (type_0 == Class28.type_0)
        {
            @class = new Class166();
            if (object_0 != null && object_0.GetType() != Class28.type_0)
            {
                @class.method_1(object_0.GetType());
            }
        }
        else if (Class99.smethod_0 <Array>(type_0))
        {
            @class = new Class140();
        }
        else if (Class99.smethod_0 <string>(type_0))
        {
            @class = new Class143();
        }
        else if (Class99.smethod_0 <IntPtr>(type_0))
        {
            @class = new Class146();
        }
        else if (Class99.smethod_0 <UIntPtr>(type_0))
        {
            @class = new Class157();
        }
        else if (Class99.smethod_0 <ulong>(type_0))
        {
            @class = new Class165();
        }
        else if (Class99.smethod_0 <uint>(type_0))
        {
            @class = new Class163();
        }
        else if (Class99.smethod_0 <ushort>(type_0))
        {
            @class = new Class159();
        }
        else if (Class99.smethod_0 <long>(type_0))
        {
            @class = new Class156();
        }
        else if (Class99.smethod_0 <int>(type_0))
        {
            @class = new Class145();
        }
        else if (Class99.smethod_0 <short>(type_0))
        {
            @class = new Class141();
        }
        else if (Class99.smethod_0 <byte>(type_0))
        {
            @class = new Class164();
        }
        else if (Class99.smethod_0 <sbyte>(type_0))
        {
            @class = new Class161();
        }
        else if (Class99.smethod_0 <double>(type_0))
        {
            @class = new Class158();
        }
        else if (Class99.smethod_0 <float>(type_0))
        {
            @class = new Class162();
        }
        else if (Class99.smethod_0 <bool>(type_0))
        {
            @class = new Class144();
        }
        else if (Class99.smethod_0 <char>(type_0))
        {
            @class = new Class155();
        }
        else if (Class28.smethod_0(type_0))
        {
            Class166 class2 = new Class166();
            class2.method_1(type_0);
            @class = class2;
        }
        else
        {
            if (Class99.smethod_0 <Enum>(type_0))
            {
                Enum enum_;
                if (object_0 == null)
                {
                    if (type_0 == Class28.type_2)
                    {
                        enum_ = null;
                    }
                    else
                    {
                        enum_ = (Enum)Activator.CreateInstance(type_0);
                    }
                }
                else if (type_0 == Class28.type_2 && object_0 is Enum)
                {
                    enum_ = (Enum)object_0;
                }
                else
                {
                    enum_ = (Enum)Enum.ToObject(type_0, object_0);
                }
                return(new Class160(enum_));
            }
            if (Class99.smethod_0 <ValueType>(type_0))
            {
                if (object_0 == null)
                {
                    object object_;
                    if (type_0 == Class28.type_3)
                    {
                        object_ = null;
                    }
                    else
                    {
                        object_ = Activator.CreateInstance(type_0);
                    }
                    @class = new Class154(object_);
                }
                else
                {
                    if (object_0.GetType() != type_0)
                    {
                        try
                        {
                            object_0 = Convert.ChangeType(object_0, type_0);
                        }
                        catch
                        {
                        }
                    }
                    @class = new Class154(object_0);
                }
                return(@class);
            }
            @class = new Class166();
        }
        if (object_0 != null)
        {
            @class.vmethod_1(object_0);
        }
        return(@class);
    }