Пример #1
0
    private int method_10(Stream A_0, object A_1)
    {
        PropertyType @bool;

        if (A_1 is int)
        {
            @bool = PropertyType.Int32;
        }
        else if (A_1 is double)
        {
            @bool = PropertyType.Double;
        }
        else if (A_1 is bool)
        {
            @bool = PropertyType.Bool;
        }
        else
        {
            if (!(A_1 is string))
            {
                throw new NotImplementedException();
            }
            @bool = PropertyType.String;
        }
        Class1115.smethod_4(A_0, (int)@bool);
        return(this.method_14(A_0, A_1, @bool) + 4);
    }
Пример #2
0
    private void method_4(Stream A_0)
    {
        Class1115.smethod_4(A_0, 0xfffe);
        Class1115.smethod_3(A_0, 0x105);
        Class1115.smethod_3(A_0, 2);
        for (int i = 0; i < 0x10; i++)
        {
            A_0.WriteByte(0);
        }
        int count = this.list_0.Count;

        Class1115.smethod_4(A_0, count);
        List <long> list = new List <long>();

        for (int j = 0; j < count; j++)
        {
            Class663 class3 = this.list_0[j];
            byte[]   buffer = class3.method_2().ToByteArray();
            A_0.Write(buffer, 0, buffer.Length);
            list.Add(A_0.Position);
            Class1115.smethod_4(A_0, 0);
        }
        for (int k = 0; k < count; k++)
        {
            Class663 class2   = this.list_0[k];
            long     position = A_0.Position;
            A_0.Position = list[k];
            Class1115.smethod_4(A_0, (int)position);
            A_0.Position = position;
            class2.method_11(A_0);
        }
    }
Пример #3
0
    private int method_15(Stream A_0, byte[] A_1)
    {
        int num    = 0;
        int length = A_1.Length;

        num = 0 + Class1115.smethod_4(A_0, length);
        A_0.Write(A_1, 0, length);
        return(num + length);
    }
Пример #4
0
        public int Serialize(Stream stream)
        {
            int num    = 0;
            int length = this.Data.Length;

            num  = 0 + Class1115.smethod_4(stream, length);
            num += Class1115.smethod_4(stream, this.Format);
            stream.Write(this.Data, 0, length);
            return(num + length);
        }
Пример #5
0
    private int method_12(Stream A_0, Dictionary <int, string> A_1)
    {
        int num   = 0;
        int count = A_1.Count;

        num = 0 + Class1115.smethod_4(A_0, count);
        foreach (KeyValuePair <int, string> pair in A_1)
        {
            num += Class1115.smethod_4(A_0, pair.Key);
            num += Class1115.smethod_8(A_0, pair.Value);
        }
        return(num);
    }
Пример #6
0
    private int method_13(Stream A_0, IList A_1)
    {
        int count = A_1.Count;

        Class1115.smethod_4(A_0, count);
        int          num2 = 4;
        PropertyType type = this.propertyType_0 & ~PropertyType.Vector;

        for (int i = 0; i < count; i++)
        {
            num2 += this.method_14(A_0, A_1[i], type);
        }
        return(num2);
    }
Пример #7
0
    public void method_11(Stream A_0)
    {
        this.int_1 = (int)A_0.Position;
        Class1115.smethod_4(A_0, 0);
        Dictionary <int, string> dictionary = this.method_12();

        new Class937(1)
        {
            propertyType_0 = PropertyType.Int16
        }.method_16((dictionary.Count == 0) ? ((short)0x4e3) : ((short)(-535)));
        for (int i = this.list_0.Count - 1; i >= 0; i--)
        {
            Class937 local1 = this.list_0[i];
        }
        int count = this.list_0.Count;

        Class1115.smethod_4(A_0, count);
        A_0.Position += (count * 4) * 2;
        List <int> list = new List <int>();

        for (int j = 0; j < count; j++)
        {
            Class937 class3 = this.list_0[j];
            list.Add((int)A_0.Position);
            class3.method_11(A_0);
        }
        long position = A_0.Position;

        A_0.Position = this.int_1 + 8;
        int num4 = 0;
        int num5 = list.Count;

        while (num4 < num5)
        {
            int num6 = list[num4] - this.int_1;
            Class1115.smethod_4(A_0, this.list_0[num4].Interface37.imethod_3());
            Class1115.smethod_4(A_0, num6);
            num4++;
        }
        this.int_2   = ((int)position) - this.int_1;
        A_0.Position = this.int_1;
        Class1115.smethod_4(A_0, this.int_2);
        A_0.Position = position;
    }
Пример #8
0
    public int method_11(Stream A_0)
    {
        int num = Class1115.smethod_4(A_0, (int)this.propertyType_0);

        if ((this.propertyType_0 & PropertyType.Vector) == PropertyType.Vector)
        {
            num += this.method_13(A_0, (IList)this.object_0);
        }
        else if (this.Interface37.imethod_3() == 0)
        {
            if (this.object_0 != null)
            {
                A_0.Position -= 4L;
                num          += this.method_12(A_0, (Dictionary <int, string>) this.object_0);
            }
        }
        else
        {
            num += this.method_14(A_0, this.object_0, this.propertyType_0);
        }
        Class1115.smethod_11(A_0, ref num);
        return(num);
    }
Пример #9
0
    private int method_14(Stream A_0, object A_1, PropertyType A_2)
    {
        int num = 0;

        switch (A_2)
        {
        case PropertyType.Empty:
        case PropertyType.Null:
            return(num);

        case PropertyType.Int16:
            return(num + Class1115.smethod_3(A_0, (short)A_1));

        case PropertyType.Int32:
        case PropertyType.Int:
            return(num + Class1115.smethod_4(A_0, (int)A_1));

        case PropertyType.Double:
            return(num + Class1115.smethod_5(A_0, (double)A_1));

        case PropertyType.Bool:
        {
            bool flag = (bool)A_1;
            return(num + Class1115.smethod_4(A_0, flag ? 1 : 0));
        }

        case PropertyType.Object:
            return(num + this.method_10(A_0, A_1));

        case PropertyType.UInt32:
            return(num + Class1115.smethod_4(A_0, (int)((uint)A_1)));

        case PropertyType.AsciiString:
            return(num + Class1115.smethod_8(A_0, (string)A_1));

        case PropertyType.String:
            return(num + Class1115.smethod_9(A_0, (string)A_1));

        case PropertyType.DateTime:
        {
            DateTime time;
            if (A_1 is TimeSpan)
            {
                TimeSpan span = (TimeSpan)A_1;
                time = DateTime.FromBinary(span.Ticks);
            }
            else
            {
                time = (DateTime)A_1;
            }
            if (this.Interface37.imethod_3() != 10)
            {
                time = time.ToUniversalTime();
            }
            ulong  num2  = (ulong)(time.Ticks - 0x701ce1722770000L);
            byte[] bytes = BitConverter.GetBytes(num2);
            A_0.Write(bytes, 0, bytes.Length);
            return(num + bytes.Length);
        }

        case PropertyType.Blob:
        {
            byte[] buffer = (byte[])A_1;
            return(num + this.method_15(A_0, buffer));
        }
        }
        throw new NotImplementedException();
    }