Пример #1
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);
            }
        }
Пример #2
0
        // Token: 0x06001033 RID: 4147 RVA: 0x000516F8 File Offset: 0x0004F8F8
        private void smethod_2970(Class_285 arg_0, Class_389 arg_1, Class_387 arg_2, string str_0, XmlNamespaceManager arg_3)
        {
            if (string.IsNullOrEmpty(str_0))
            {
                throw new Class_417("XmlNodeConverter cannot convert JSON with an empty property name to XML.");
            }
            Dictionary <string, string> dictionary = this.cmethod_2974(arg_0, arg_3);
            string prefix = Class_513.GetPrefix(str_0);

            if (str_0.StartsWith('@'))
            {
                string    text    = str_0.Substring(1);
                string    text2   = arg_0.prop_10.ToString();
                string    prefix2 = Class_513.GetPrefix(text);
                Class_387 arg_4   = (!string.IsNullOrEmpty(prefix2)) ? arg_1.tmethod_2842(text, arg_3.LookupNamespace(prefix2), text2) : arg_1.xmethod_2841(text, text2);
                ((Class_391)arg_2).kmethod_2857(arg_4);
                return;
            }
            Class_391 class_ = this.kmethod_2977(str_0, arg_1, prefix, arg_3);

            arg_2.kmethod_2817(class_);
            foreach (KeyValuePair <string, string> keyValuePair in dictionary)
            {
                string    prefix3 = Class_513.GetPrefix(keyValuePair.Key);
                Class_387 arg_5   = (!string.IsNullOrEmpty(prefix3)) ? arg_1.tmethod_2842(keyValuePair.Key, arg_3.LookupNamespace(prefix3), keyValuePair.Value) : arg_1.xmethod_2841(keyValuePair.Key, keyValuePair.Value);
                class_.kmethod_2857(arg_5);
            }
            if (arg_0.prop_9 == Class_508.String || arg_0.prop_9 == Class_508.Integer || arg_0.prop_9 == Class_508.Float || arg_0.prop_9 == Class_508.Boolean || arg_0.prop_9 == Class_508.Date)
            {
                class_.kmethod_2817(arg_1.tmethod_2832(this.xmethod_2971(arg_0)));
                return;
            }
            if (arg_0.prop_9 == Class_508.Null)
            {
                return;
            }
            if (arg_0.prop_9 != Class_508.EndObject)
            {
                arg_3.PushScope();
                this.lmethod_2978(arg_0, arg_1, arg_3, class_);
                arg_3.PopScope();
            }
            arg_3.RemoveNamespace(string.Empty, arg_3.DefaultNamespace);
        }