Пример #1
0
        // Token: 0x06000C13 RID: 3091 RVA: 0x00043714 File Offset: 0x00041914
        private object cmethod_2174(Class_285 arg_0)
        {
            IDictionary <string, object> dictionary = new ExpandoObject();

            while (arg_0.vmethod_1885())
            {
                Class_508 class_ = arg_0.prop_9;
                switch (class_)
                {
                case Class_508.PropertyName:
                {
                    string key = arg_0.prop_10.ToString();
                    if (!arg_0.vmethod_1885())
                    {
                        throw Class_417.xmethod_3101(arg_0, "Unexpected end when reading ExpandoObject.");
                    }
                    object value = this.tmethod_2172(arg_0);
                    dictionary[key] = value;
                    break;
                }

                case Class_508.Comment:
                    break;

                default:
                    if (class_ == Class_508.EndObject)
                    {
                        return(dictionary);
                    }
                    break;
                }
            }
            throw Class_417.xmethod_3101(arg_0, "Unexpected end when reading ExpandoObject.");
        }
Пример #2
0
        // Token: 0x06000C28 RID: 3112 RVA: 0x00043D68 File Offset: 0x00041F68
        private Regex xmethod_2191(Class_285 arg_0, Class_418 arg_1)
        {
            string       text         = null;
            RegexOptions?regexOptions = null;

            while (arg_0.vmethod_1885())
            {
                Class_508 class_ = arg_0.prop_9;
                switch (class_)
                {
                case Class_508.PropertyName:
                {
                    string a = arg_0.prop_10.ToString();
                    if (!arg_0.vmethod_1885())
                    {
                        throw Class_417.xmethod_3101(arg_0, "Unexpected end when reading Regex.");
                    }
                    if (string.Equals(a, "Pattern", StringComparison.OrdinalIgnoreCase))
                    {
                        text = (string)arg_0.prop_10;
                    }
                    else if (string.Equals(a, "Options", StringComparison.OrdinalIgnoreCase))
                    {
                        regexOptions = new RegexOptions?(arg_1.pmethod_3169 <RegexOptions>(arg_0));
                    }
                    else
                    {
                        arg_0.smethod_1900();
                    }
                    break;
                }

                case Class_508.Comment:
                    break;

                default:
                    if (class_ == Class_508.EndObject)
                    {
                        if (text == null)
                        {
                            throw Class_417.xmethod_3101(arg_0, "Error deserializing Regex. No pattern found.");
                        }
                        return(new Regex(text, regexOptions ?? RegexOptions.None));
                    }
                    break;
                }
            }
            throw Class_417.xmethod_3101(arg_0, "Unexpected end when reading Regex.");
        }
Пример #3
0
        // Token: 0x06001035 RID: 4149 RVA: 0x00051A38 File Offset: 0x0004FC38
        private void tmethod_2972(Class_285 arg_0, Class_389 arg_1, string str_0, Class_387 arg_2, XmlNamespaceManager arg_3)
        {
            Func <Class_391, bool> func = null;

            Class_407.NClass_1 nclass_ = new Class_407.NClass_1();
            nclass_.field_2 = str_0;
            string    prefix = Class_513.GetPrefix(nclass_.field_2);
            Class_391 class_ = this.kmethod_2977(nclass_.field_2, arg_1, prefix, arg_3);

            arg_2.kmethod_2817(class_);
            int num = 0;

            while (arg_0.vmethod_1885() && arg_0.prop_9 != Class_508.EndArray)
            {
                this.pmethod_2969(arg_0, arg_1, arg_3, nclass_.field_2, class_);
                num++;
            }
            if (this.prop_1)
            {
                this.gmethod_2973(class_, arg_1);
            }
            if (num == 1 && this.prop_1)
            {
                IEnumerable <Class_391> source = class_.prop_2.OfType <Class_391>();
                if (func == null)
                {
                    func = new Func <Class_391, bool>(nclass_.nmethod_3);
                }
                Class_391 arg_4 = source.Single(func);
                this.gmethod_2973(arg_4, arg_1);
            }
        }
Пример #4
0
 // Token: 0x06000C1B RID: 3099 RVA: 0x00043A2E File Offset: 0x00041C2E
 private static void xmethod_2181(Class_285 arg_0)
 {
     if (!arg_0.vmethod_1885())
     {
         throw Class_417.xmethod_3101(arg_0, "Unexpected end when reading KeyValuePair.");
     }
 }
Пример #5
0
        // Token: 0x06000C11 RID: 3089 RVA: 0x00043624 File Offset: 0x00041824
        private object tmethod_2172(Class_285 arg_0)
        {
            while (arg_0.prop_9 == Class_508.Comment)
            {
                if (!arg_0.vmethod_1885())
                {
                    throw Class_417.xmethod_3101(arg_0, "Unexpected end when reading ExpandoObject.");
                }
            }
            switch (arg_0.prop_9)
            {
            case Class_508.StartObject:
                return(this.cmethod_2174(arg_0));

            case Class_508.StartArray:
                return(this.gmethod_2173(arg_0));

            default:
                if (Class_486.IsPrimitiveToken(arg_0.prop_9))
                {
                    return(arg_0.prop_10);
                }
                throw Class_417.xmethod_3101(arg_0, "Unexpected token when converting ExpandoObject: {0}".FormatWith(CultureInfo.InvariantCulture, arg_0.prop_9));
            }
        }
Пример #6
0
 // Token: 0x06000BF8 RID: 3064 RVA: 0x00042E7F File Offset: 0x0004107F
 private static void tmethod_2152(Class_285 arg_0)
 {
     if (!arg_0.vmethod_1885())
     {
         throw Class_417.xmethod_3101(arg_0, "Unexpected end when reading DataTable.");
     }
 }
Пример #7
0
 // Token: 0x06000BF2 RID: 3058 RVA: 0x00042A10 File Offset: 0x00040C10
 private void kmethod_2147(Class_285 arg_0)
 {
     if (!arg_0.vmethod_1885())
     {
         throw Class_417.xmethod_3101(arg_0, "Unexpected end when reading DataSet.");
     }
 }
Пример #8
0
 // Token: 0x06000C06 RID: 3078 RVA: 0x00043377 File Offset: 0x00041577
 private static void gmethod_2163(Class_285 arg_0)
 {
     if (!arg_0.vmethod_1885())
     {
         throw Class_417.xmethod_3101(arg_0, "Unexpected end when reading union.");
     }
 }
Пример #9
0
        // Token: 0x06000BEC RID: 3052 RVA: 0x000427C0 File Offset: 0x000409C0
        private byte[] tmethod_2142(Class_285 arg_0)
        {
            List <byte> list = new List <byte>();

            while (arg_0.vmethod_1885())
            {
                Class_508 class_ = arg_0.prop_9;
                switch (class_)
                {
                case Class_508.Comment:
                    continue;

                case Class_508.Raw:
                    break;

                case Class_508.Integer:
                    list.Add(Convert.ToByte(arg_0.prop_10, CultureInfo.InvariantCulture));
                    continue;

                default:
                    if (class_ == Class_508.EndArray)
                    {
                        return(list.ToArray());
                    }
                    break;
                }
                throw Class_417.xmethod_3101(arg_0, "Unexpected token when reading bytes: {0}".FormatWith(CultureInfo.InvariantCulture, arg_0.prop_9));
            }
            throw Class_417.xmethod_3101(arg_0, "Unexpected end when reading bytes.");
        }
Пример #10
0
 // Token: 0x06000C0A RID: 3082 RVA: 0x00043508 File Offset: 0x00041708
 private static void dmethod_2166(Class_285 arg_0)
 {
     if (!arg_0.vmethod_1885())
     {
         throw new Class_417("Unexpected end.");
     }
 }
Пример #11
0
        // Token: 0x06001031 RID: 4145 RVA: 0x00051454 File Offset: 0x0004F654
        public virtual object lmethod_2968(Class_285 arg_0, Type arg_1, object obje_0, Class_418 arg_2)
        {
            if (arg_0.prop_9 == Class_508.Null)
            {
                return(null);
            }
            XmlNamespaceManager xmlNamespaceManager = new XmlNamespaceManager(new NameTable());
            Class_389           class_  = null;
            Class_387           class_2 = null;

            if (typeof(XObject).IsAssignableFrom(arg_1))
            {
                if (arg_1 != typeof(XDocument) && arg_1 != typeof(XElement))
                {
                    throw new Class_417("XmlNodeConverter only supports deserializing XDocument or XElement.");
                }
                XDocument arg_3 = new XDocument();
                class_  = new Class_401(arg_3);
                class_2 = class_;
            }
            if (typeof(XmlNode).IsAssignableFrom(arg_1))
            {
                if (arg_1 != typeof(XmlDocument))
                {
                    throw new Class_417("XmlNodeConverter only supports deserializing XmlDocuments");
                }
                class_ = new Class_390(new XmlDocument
                {
                    XmlResolver = null
                });
                class_2 = class_;
            }
            if (class_ == null || class_2 == null)
            {
                throw new Class_417("Unexpected type when converting XML: " + arg_1);
            }
            if (arg_0.prop_9 != Class_508.StartObject)
            {
                throw new Class_417("XmlNodeConverter can only convert JSON that begins with an object.");
            }
            if (!string.IsNullOrEmpty(this.prop_0))
            {
                this.smethod_2970(arg_0, class_, class_2, this.prop_0, xmlNamespaceManager);
            }
            else
            {
                arg_0.vmethod_1885();
                this.lmethod_2978(arg_0, class_, xmlNamespaceManager, class_2);
            }
            if (arg_1 == typeof(XElement))
            {
                XElement xelement = (XElement)class_.prop_0.prop_7;
                xelement.Remove();
                return(xelement);
            }
            return(class_.prop_7);
        }
Пример #12
0
        // Token: 0x06001039 RID: 4153 RVA: 0x00051EA0 File Offset: 0x000500A0
        private void dmethod_2976(Class_285 arg_0, Class_389 arg_1, Class_387 arg_2)
        {
            string str_  = null;
            string str_2 = null;
            string str_3 = null;
            string str_4 = null;

            while (arg_0.vmethod_1885() && arg_0.prop_9 != Class_508.EndObject)
            {
                string a;
                if ((a = arg_0.prop_10.ToString()) != null)
                {
                    if (a == "@name")
                    {
                        arg_0.vmethod_1885();
                        str_ = arg_0.prop_10.ToString();
                        continue;
                    }
                    if (a == "@public")
                    {
                        arg_0.vmethod_1885();
                        str_2 = arg_0.prop_10.ToString();
                        continue;
                    }
                    if (a == "@system")
                    {
                        arg_0.vmethod_1885();
                        str_3 = arg_0.prop_10.ToString();
                        continue;
                    }
                    if (a == "@internalSubset")
                    {
                        arg_0.vmethod_1885();
                        str_4 = arg_0.prop_10.ToString();
                        continue;
                    }
                }
                throw new Class_417("Unexpected property name encountered while deserializing XmlDeclaration: " + arg_0.prop_10);
            }
            Class_387 arg_3 = arg_1.kmethod_2837(str_, str_2, str_3, str_4);

            arg_2.kmethod_2817(arg_3);
        }
Пример #13
0
        // Token: 0x06001299 RID: 4761 RVA: 0x00059CAC File Offset: 0x00057EAC
        public static Class_424 xmethod_3351(Class_285 arg_0)
        {
            if (arg_0.prop_9 == Class_508.None && !arg_0.vmethod_1885())
            {
                throw Class_414.lmethod_3098(arg_0, "Error reading JArray from JsonReader.");
            }
            while (arg_0.prop_9 == Class_508.Comment)
            {
                arg_0.vmethod_1885();
            }
            if (arg_0.prop_9 != Class_508.StartArray)
            {
                throw Class_414.lmethod_3098(arg_0, "Error reading JArray from JsonReader. Current JsonReader item is not an array: {0}".FormatWith(CultureInfo.InvariantCulture, arg_0.prop_9));
            }
            Class_424 class_ = new Class_424();

            class_.lmethod_2568(arg_0 as Class_353);
            class_.pmethod_3229(arg_0);
            return(class_);
        }
Пример #14
0
        // Token: 0x0600123E RID: 4670 RVA: 0x00058EB8 File Offset: 0x000570B8
        public static Class_421 lmethod_3288(Class_285 arg_0)
        {
            if (arg_0.prop_9 == Class_508.None && !arg_0.vmethod_1885())
            {
                throw Class_414.lmethod_3098(arg_0, "Error reading JConstructor from JsonReader.");
            }
            while (arg_0.prop_9 == Class_508.Comment)
            {
                arg_0.vmethod_1885();
            }
            if (arg_0.prop_9 != Class_508.StartConstructor)
            {
                throw Class_414.lmethod_3098(arg_0, "Error reading JConstructor from JsonReader. Current JsonReader item is not a constructor: {0}".FormatWith(CultureInfo.InvariantCulture, arg_0.prop_9));
            }
            Class_421 class_ = new Class_421((string)arg_0.prop_10);

            class_.lmethod_2568(arg_0 as Class_353);
            class_.pmethod_3229(arg_0);
            return(class_);
        }
Пример #15
0
        // Token: 0x06001301 RID: 4865 RVA: 0x0005AB0C File Offset: 0x00058D0C
        public static Class_427 kmethod_3447(Class_285 arg_0)
        {
            if (arg_0.prop_9 == Class_508.None && !arg_0.vmethod_1885())
            {
                throw Class_414.lmethod_3098(arg_0, "Error reading JProperty from JsonReader.");
            }
            while (arg_0.prop_9 == Class_508.Comment)
            {
                arg_0.vmethod_1885();
            }
            if (arg_0.prop_9 != Class_508.PropertyName)
            {
                throw Class_414.lmethod_3098(arg_0, "Error reading JProperty from JsonReader. Current JsonReader item is not a property: {0}".FormatWith(CultureInfo.InvariantCulture, arg_0.prop_9));
            }
            Class_427 class_ = new Class_427((string)arg_0.prop_10);

            class_.lmethod_2568(arg_0 as Class_353);
            class_.pmethod_3229(arg_0);
            return(class_);
        }
Пример #16
0
        // Token: 0x06001038 RID: 4152 RVA: 0x00051D80 File Offset: 0x0004FF80
        private void vmethod_2975(Class_285 arg_0, Class_389 arg_1, Class_387 arg_2, string str_0)
        {
            if (str_0 == "?xml")
            {
                string str_  = null;
                string str_2 = null;
                string str_3 = null;
                while (arg_0.vmethod_1885() && arg_0.prop_9 != Class_508.EndObject)
                {
                    string a;
                    if ((a = arg_0.prop_10.ToString()) != null)
                    {
                        if (a == "@version")
                        {
                            arg_0.vmethod_1885();
                            str_ = arg_0.prop_10.ToString();
                            continue;
                        }
                        if (a == "@encoding")
                        {
                            arg_0.vmethod_1885();
                            str_2 = arg_0.prop_10.ToString();
                            continue;
                        }
                        if (a == "@standalone")
                        {
                            arg_0.vmethod_1885();
                            str_3 = arg_0.prop_10.ToString();
                            continue;
                        }
                    }
                    throw new Class_417("Unexpected property name encountered while deserializing XmlDeclaration: " + arg_0.prop_10);
                }
                Class_387 arg_3 = arg_1.dmethod_2836(str_, str_2, str_3);
                arg_2.kmethod_2817(arg_3);
                return;
            }
            Class_387 arg_4 = arg_1.lmethod_2838(str_0.Substring(1), arg_0.prop_10.ToString());

            arg_2.kmethod_2817(arg_4);
        }
Пример #17
0
        // Token: 0x0600125F RID: 4703 RVA: 0x0005952C File Offset: 0x0005772C
        public static Class_423 pmethod_3309(Class_285 arg_0)
        {
            Class_517.ArgumentNotNull(arg_0, "reader");
            if (arg_0.prop_9 == Class_508.None && !arg_0.vmethod_1885())
            {
                throw Class_414.lmethod_3098(arg_0, "Error reading JObject from JsonReader.");
            }
            while (arg_0.prop_9 == Class_508.Comment)
            {
                arg_0.vmethod_1885();
            }
            if (arg_0.prop_9 != Class_508.StartObject)
            {
                throw Class_414.lmethod_3098(arg_0, "Error reading JObject from JsonReader. Current JsonReader item is not an object: {0}".FormatWith(CultureInfo.InvariantCulture, arg_0.prop_9));
            }
            Class_423 class_ = new Class_423();

            class_.lmethod_2568(arg_0 as Class_353);
            class_.pmethod_3229(arg_0);
            return(class_);
        }
Пример #18
0
        // Token: 0x06000F82 RID: 3970 RVA: 0x0004FF28 File Offset: 0x0004E128
        public virtual object pmethod_2809(Class_285 arg_0, Type arg_1, object obje_0, Class_418 arg_2)
        {
            Type left = Class_514.IsNullableType(arg_1) ? Nullable.GetUnderlyingType(arg_1) : arg_1;

            if (arg_0.prop_9 == Class_508.Null)
            {
                if (!Class_514.IsNullable(arg_1))
                {
                    throw Class_417.xmethod_3101(arg_0, "Cannot convert null value to {0}.".FormatWith(CultureInfo.InvariantCulture, arg_1));
                }
                return(null);
            }
            else
            {
                if (arg_0.prop_9 != Class_508.StartConstructor || !string.Equals(arg_0.prop_10.ToString(), "Date", StringComparison.Ordinal))
                {
                    throw Class_417.xmethod_3101(arg_0, "Unexpected token or value when parsing date. Token: {0}, Value: {1}".FormatWith(CultureInfo.InvariantCulture, arg_0.prop_9, arg_0.prop_10));
                }
                arg_0.vmethod_1885();
                if (arg_0.prop_9 != Class_508.Integer)
                {
                    throw Class_417.xmethod_3101(arg_0, "Unexpected token parsing date. Expected Integer, got {0}.".FormatWith(CultureInfo.InvariantCulture, arg_0.prop_9));
                }
                long     javaScriptTicks = (long)arg_0.prop_10;
                DateTime dateTime        = Class_502.ConvertJavaScriptTicksToDateTime(javaScriptTicks);
                arg_0.vmethod_1885();
                if (arg_0.prop_9 != Class_508.EndConstructor)
                {
                    throw Class_417.xmethod_3101(arg_0, "Unexpected token parsing date. Expected EndConstructor, got {0}.".FormatWith(CultureInfo.InvariantCulture, arg_0.prop_9));
                }
                if (left == typeof(DateTimeOffset))
                {
                    return(new DateTimeOffset(dateTime));
                }
                return(dateTime);
            }
        }
Пример #19
0
        // Token: 0x060011F0 RID: 4592 RVA: 0x000582A8 File Offset: 0x000564A8
        internal void pmethod_3229(Class_285 arg_0)
        {
            int num = arg_0.prop_12;

            if (!arg_0.vmethod_1885())
            {
                throw Class_414.lmethod_3098(arg_0, "Error reading {0} from JsonReader.".FormatWith(CultureInfo.InvariantCulture, base.GetType().Name));
            }
            this.smethod_3230(arg_0);
            int num2 = arg_0.prop_12;

            if (num2 > num)
            {
                throw Class_414.lmethod_3098(arg_0, "Unexpected end of content while loading {0}.".FormatWith(CultureInfo.InvariantCulture, base.GetType().Name));
            }
        }
Пример #20
0
        // Token: 0x06000C12 RID: 3090 RVA: 0x000436BC File Offset: 0x000418BC
        private object gmethod_2173(Class_285 arg_0)
        {
            IList <object> list = new List <object>();

            while (arg_0.vmethod_1885())
            {
                Class_508 class_ = arg_0.prop_9;
                if (class_ != Class_508.Comment)
                {
                    if (class_ == Class_508.EndArray)
                    {
                        return(list);
                    }
                    object item = this.tmethod_2172(arg_0);
                    list.Add(item);
                }
            }
            throw Class_417.xmethod_3101(arg_0, "Unexpected end when reading ExpandoObject.");
        }
Пример #21
0
        // Token: 0x0600103B RID: 4155 RVA: 0x0005200C File Offset: 0x0005020C
        private void lmethod_2978(Class_285 arg_0, Class_389 arg_1, XmlNamespaceManager arg_2, Class_387 arg_3)
        {
            Class_508 class_;

            for (;;)
            {
                Func <Class_391, bool> func    = null;
                Class_407.NClass_2     nclass_ = new Class_407.NClass_2();
                class_ = arg_0.prop_9;
                switch (class_)
                {
                case Class_508.StartConstructor:
                {
                    string str_ = arg_0.prop_10.ToString();
                    while (arg_0.vmethod_1885())
                    {
                        if (arg_0.prop_9 == Class_508.EndConstructor)
                        {
                            break;
                        }
                        this.pmethod_2969(arg_0, arg_1, arg_2, str_, arg_3);
                    }
                    goto IL_182;
                }

                case Class_508.PropertyName:
                {
                    if (arg_3.prop_0 == XmlNodeType.Document && arg_1.prop_0 != null)
                    {
                        goto Block_3;
                    }
                    nclass_.field_3 = arg_0.prop_10.ToString();
                    arg_0.vmethod_1885();
                    if (arg_0.prop_9 != Class_508.StartArray)
                    {
                        this.pmethod_2969(arg_0, arg_1, arg_2, nclass_.field_3, arg_3);
                        goto IL_182;
                    }
                    int num = 0;
                    while (arg_0.vmethod_1885() && arg_0.prop_9 != Class_508.EndArray)
                    {
                        this.pmethod_2969(arg_0, arg_1, arg_2, nclass_.field_3, arg_3);
                        num++;
                    }
                    if (num == 1 && this.prop_1)
                    {
                        IEnumerable <Class_391> source = arg_3.prop_2.OfType <Class_391>();
                        if (func == null)
                        {
                            func = new Func <Class_391, bool>(nclass_.nmethod_5);
                        }
                        Class_391 arg_4 = source.Single(func);
                        this.gmethod_2973(arg_4, arg_1);
                        goto IL_182;
                    }
                    goto IL_182;
                }

                case Class_508.Comment:
                    arg_3.kmethod_2817(arg_1.xmethod_2831((string)arg_0.prop_10));
                    goto IL_182;
                }
                break;
IL_182:
                if (arg_0.prop_9 != Class_508.PropertyName && !arg_0.vmethod_1885())
                {
                    return;
                }
            }
            switch (class_)
            {
            case Class_508.EndObject:
            case Class_508.EndArray:
                return;

            default:
                throw new Class_417("Unexpected JsonToken when deserializing node: " + arg_0.prop_9);
            }
Block_3:
            throw new Class_417("JSON root object has multiple properties. The root object must have a single property in order to create a valid XML document. Consider specifing a DeserializeRootElementName.");
        }
Пример #22
0
        // Token: 0x060011F1 RID: 4593 RVA: 0x00058320 File Offset: 0x00056520
        internal void smethod_3230(Class_285 arg_0)
        {
            Class_517.ArgumentNotNull(arg_0, "r");
            Class_353 arg_   = arg_0 as Class_353;
            Class_420 class_ = this;

            for (;;)
            {
                if (class_ is Class_427 && ((Class_427)class_).prop_2 != null)
                {
                    if (class_ == this)
                    {
                        break;
                    }
                    class_ = class_.prop_1;
                }
                switch (arg_0.prop_9)
                {
                case Class_508.None:
                    goto IL_22F;

                case Class_508.StartObject:
                {
                    Class_423 class_2 = new Class_423();
                    class_2.lmethod_2568(arg_);
                    class_.lmethod_3218(class_2);
                    class_ = class_2;
                    goto IL_22F;
                }

                case Class_508.StartArray:
                {
                    Class_424 class_3 = new Class_424();
                    class_3.lmethod_2568(arg_);
                    class_.lmethod_3218(class_3);
                    class_ = class_3;
                    goto IL_22F;
                }

                case Class_508.StartConstructor:
                {
                    Class_421 class_4 = new Class_421(arg_0.prop_10.ToString());
                    class_4.lmethod_2568(arg_);
                    class_.lmethod_3218(class_4);
                    class_ = class_4;
                    goto IL_22F;
                }

                case Class_508.PropertyName:
                {
                    string    str_    = arg_0.prop_10.ToString();
                    Class_427 class_5 = new Class_427(str_);
                    class_5.lmethod_2568(arg_);
                    Class_423 class_6 = (Class_423)class_;
                    Class_427 class_7 = class_6.gmethod_3303(str_);
                    if (class_7 == null)
                    {
                        class_.lmethod_3218(class_5);
                    }
                    else
                    {
                        class_7.gmethod_2473(class_5);
                    }
                    class_ = class_5;
                    goto IL_22F;
                }

                case Class_508.Comment:
                {
                    Class_362 class_8 = Class_362.vmethod_2595(arg_0.prop_10.ToString());
                    class_8.lmethod_2568(arg_);
                    class_.lmethod_3218(class_8);
                    goto IL_22F;
                }

                case Class_508.Integer:
                case Class_508.Float:
                case Class_508.String:
                case Class_508.Boolean:
                case Class_508.Date:
                case Class_508.Bytes:
                {
                    Class_362 class_8 = new Class_362(arg_0.prop_10);
                    class_8.lmethod_2568(arg_);
                    class_.lmethod_3218(class_8);
                    goto IL_22F;
                }

                case Class_508.Null:
                {
                    Class_362 class_8 = Class_362.kmethod_2597();
                    class_8.lmethod_2568(arg_);
                    class_.lmethod_3218(class_8);
                    goto IL_22F;
                }

                case Class_508.Undefined:
                {
                    Class_362 class_8 = Class_362.lmethod_2598();
                    class_8.lmethod_2568(arg_);
                    class_.lmethod_3218(class_8);
                    goto IL_22F;
                }

                case Class_508.EndObject:
                    if (class_ == this)
                    {
                        return;
                    }
                    class_ = class_.prop_1;
                    goto IL_22F;

                case Class_508.EndArray:
                    if (class_ == this)
                    {
                        return;
                    }
                    class_ = class_.prop_1;
                    goto IL_22F;

                case Class_508.EndConstructor:
                    if (class_ == this)
                    {
                        return;
                    }
                    class_ = class_.prop_1;
                    goto IL_22F;
                }
                goto Block_4;
IL_22F:
                if (!arg_0.vmethod_1885())
                {
                    return;
                }
            }
            return;

Block_4:
            throw new InvalidOperationException("The JsonReader should not be on a token of type {0}.".FormatWith(CultureInfo.InvariantCulture, arg_0.prop_9));
        }
Пример #23
0
        // Token: 0x06001037 RID: 4151 RVA: 0x00051B64 File Offset: 0x0004FD64
        private Dictionary <string, string> cmethod_2974(Class_285 arg_0, XmlNamespaceManager arg_1)
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();
            bool flag  = false;
            bool flag2 = false;

            if (arg_0.prop_9 != Class_508.String && arg_0.prop_9 != Class_508.Null && arg_0.prop_9 != Class_508.Boolean && arg_0.prop_9 != Class_508.Integer && arg_0.prop_9 != Class_508.Float && arg_0.prop_9 != Class_508.Date && arg_0.prop_9 != Class_508.StartConstructor)
            {
                while (!flag && !flag2 && arg_0.vmethod_1885())
                {
                    Class_508 class_ = arg_0.prop_9;
                    switch (class_)
                    {
                    case Class_508.PropertyName:
                    {
                        string text = arg_0.prop_10.ToString();
                        if (!string.IsNullOrEmpty(text))
                        {
                            char c  = text[0];
                            char c2 = c;
                            if (c2 != '$')
                            {
                                if (c2 == '@')
                                {
                                    text = text.Substring(1);
                                    arg_0.vmethod_1885();
                                    string text2 = this.xmethod_2971(arg_0);
                                    dictionary.Add(text, text2);
                                    string prefix;
                                    if (this.pmethod_2979(text, out prefix))
                                    {
                                        arg_1.AddNamespace(prefix, text2);
                                    }
                                }
                                else
                                {
                                    flag = true;
                                }
                            }
                            else
                            {
                                text = text.Substring(1);
                                arg_0.vmethod_1885();
                                string text2 = arg_0.prop_10.ToString();
                                string text3 = arg_1.LookupPrefix("http://james.newtonking.com/projects/json");
                                if (text3 == null)
                                {
                                    int?num = null;
                                    while (arg_1.LookupNamespace("json" + num) != null)
                                    {
                                        num = new int?(num.GetValueOrDefault() + 1);
                                    }
                                    text3 = "json" + num;
                                    dictionary.Add("xmlns:" + text3, "http://james.newtonking.com/projects/json");
                                    arg_1.AddNamespace(text3, "http://james.newtonking.com/projects/json");
                                }
                                dictionary.Add(text3 + ":" + text, text2);
                            }
                        }
                        else
                        {
                            flag = true;
                        }
                        break;
                    }

                    case Class_508.Comment:
                        flag2 = true;
                        break;

                    default:
                        if (class_ != Class_508.EndObject)
                        {
                            throw new Class_417("Unexpected JsonToken: " + arg_0.prop_9);
                        }
                        flag2 = true;
                        break;
                    }
                }
            }
            return(dictionary);
        }