예제 #1
0
        // Token: 0x06000C08 RID: 3080 RVA: 0x00043390 File Offset: 0x00041590
        public virtual void cmethod_2164(Class_296 arg_0, object obje_0, Class_418 arg_1)
        {
            Class_306.lmethod_2168(obje_0.GetType());
            Class_441 class_ = arg_1.prop_14 as Class_441;
            string    str_   = (string)Class_306.field_4.tmethod_4062(obje_0, "Key");
            object    obj    = Class_306.field_4.tmethod_4062(obje_0, "Value");
            Type      type   = (obj != null) ? obj.GetType() : null;

            arg_0.kmethod_2007();
            arg_0.gmethod_2013((class_ != null) ? class_.smethod_3590("Key") : "Key");
            arg_0.kmethod_2037(str_);
            arg_0.gmethod_2013((class_ != null) ? class_.smethod_3590("Type") : "Type");
            arg_0.kmethod_2037((type != null) ? type.FullName : null);
            arg_0.gmethod_2013((class_ != null) ? class_.smethod_3590("Value") : "Value");
            if (type != null)
            {
                string str_2;
                if (Class_467.gmethod_3913(obj, type, out str_2))
                {
                    arg_0.kmethod_2037(str_2);
                }
                else
                {
                    arg_0.cmethod_2074(obj);
                }
            }
            else
            {
                arg_0.gmethod_2033();
            }
            arg_0.lmethod_2008();
        }
예제 #2
0
        // Token: 0x06000A71 RID: 2673 RVA: 0x0003D980 File Offset: 0x0003BB80
        public virtual void dmethod_1816(Class_296 arg_0, object obje_0, Class_418 arg_1)
        {
            Class_275 class_ = obje_0 as Class_275;

            if (class_ == null)
            {
                throw new ArgumentException("invalid data to serialize");
            }
            arg_0.pmethod_2009();
            arg_0.pmethod_2009();
            arg_0.kmethod_2037(class_.prop_0);
            arg_0.smethod_2010();
            arg_0.pmethod_2009();
            foreach (Class_275.NClass_0 nclass_ in class_.prop_1)
            {
                arg_0.kmethod_2037(nclass_.nprop_0);
            }
            arg_0.smethod_2010();
            arg_0.pmethod_2009();
            int num = 0;

            foreach (Class_275.NClass_0 nclass_2 in class_.prop_1)
            {
                arg_0.lmethod_2038(0);
                arg_0.lmethod_2038(num++);
                arg_0.kmethod_2037(Class_223.smethod_1470(nclass_2.nprop_1, nclass_2.nprop_2).ToBase64());
            }
            arg_0.smethod_2010();
            arg_0.smethod_2010();
        }
예제 #3
0
        // Token: 0x06000F7E RID: 3966 RVA: 0x0004FC04 File Offset: 0x0004DE04
        public virtual void dmethod_2806(Class_296 arg_0, object obje_0, Class_418 arg_1)
        {
            string str_;

            if (obje_0 is DateTime)
            {
                DateTime dateTime = (DateTime)obje_0;
                if ((this.field_1 & DateTimeStyles.AdjustToUniversal) == DateTimeStyles.AdjustToUniversal || (this.field_1 & DateTimeStyles.AssumeUniversal) == DateTimeStyles.AssumeUniversal)
                {
                    dateTime = dateTime.ToUniversalTime();
                }
                str_ = dateTime.ToString(this.field_2 ?? "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK", this.prop_2);
            }
            else
            {
                if (!(obje_0 is DateTimeOffset))
                {
                    throw new Class_417("Unexpected value when converting date. Expected DateTime or DateTimeOffset, got {0}.".FormatWith(CultureInfo.InvariantCulture, Class_514.GetObjectType(obje_0)));
                }
                DateTimeOffset dateTimeOffset = (DateTimeOffset)obje_0;
                if ((this.field_1 & DateTimeStyles.AdjustToUniversal) == DateTimeStyles.AdjustToUniversal || (this.field_1 & DateTimeStyles.AssumeUniversal) == DateTimeStyles.AssumeUniversal)
                {
                    dateTimeOffset = dateTimeOffset.ToUniversalTime();
                }
                str_ = dateTimeOffset.ToString(this.field_2 ?? "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK", this.prop_2);
            }
            arg_0.kmethod_2037(str_);
        }
예제 #4
0
        // Token: 0x06000C03 RID: 3075 RVA: 0x00042F80 File Offset: 0x00041180
        public virtual void smethod_2160(Class_296 arg_0, object obje_0, Class_418 arg_1)
        {
            Class_441 class_ = arg_1.prop_14 as Class_441;
            Type      type   = obje_0.GetType();
            Class_489 <object, object> getUnionFields = Class_484.GetUnionFields;
            object target = null;

            object[] array = new object[3];
            array[0] = obje_0;
            array[1] = type;
            object arg  = getUnionFields(target, array);
            object arg2 = Class_484.GetUnionCaseInfo(arg);
            object obj  = Class_484.GetUnionCaseFields(arg);
            object obj2 = Class_484.GetUnionCaseInfoName(arg2);

            object[] array2 = obj as object[];
            arg_0.kmethod_2007();
            arg_0.gmethod_2013((class_ != null) ? class_.smethod_3590("Case") : "Case");
            arg_0.kmethod_2037((string)obj2);
            if (array2 != null && array2.Length > 0)
            {
                arg_0.gmethod_2013((class_ != null) ? class_.smethod_3590("Fields") : "Fields");
                arg_1.kmethod_3177(arg_0, obj);
            }
            arg_0.lmethod_2008();
        }
예제 #5
0
        // Token: 0x0600154E RID: 5454 RVA: 0x00065870 File Offset: 0x00063A70
        private void cmethod_3914(Class_296 arg_0, object obje_0, Class_469 arg_1)
        {
            this.vmethod_3915(arg_0, arg_1, obje_0);
            string str_;

            Class_467.gmethod_3913(obje_0, arg_1.prop_0, out str_);
            arg_0.kmethod_2037(str_);
            this.dmethod_3916(arg_0, arg_1, obje_0);
        }
예제 #6
0
        // Token: 0x06001555 RID: 5461 RVA: 0x00065E04 File Offset: 0x00064004
        private void xmethod_3921(Class_296 arg_0, Type arg_1)
        {
            string typeName = Class_514.GetTypeName(arg_1, this.field_3.field_1, this.field_3.field_13);

            if (this.field_4 != null && this.field_4.prop_0 >= TraceLevel.Verbose)
            {
                this.field_4.gmethod_2303(TraceLevel.Verbose, Class_326.FormatMessage(null, arg_0.prop_4, "Writing type name '{0}' for {1}.".FormatWith(CultureInfo.InvariantCulture, typeName, arg_1)), null);
            }
            arg_0.cmethod_2014("$type", false);
            arg_0.kmethod_2037(typeName);
        }
예제 #7
0
        // Token: 0x06001554 RID: 5460 RVA: 0x00065D94 File Offset: 0x00063F94
        private void smethod_3920(Class_296 arg_0, Type arg_1, object obje_0)
        {
            string text = this.tmethod_3912(arg_0, obje_0);

            if (this.field_4 != null && this.field_4.prop_0 >= TraceLevel.Verbose)
            {
                this.field_4.gmethod_2303(TraceLevel.Verbose, Class_326.FormatMessage(null, arg_0.prop_4, "Writing object reference Id '{0}' for {1}.".FormatWith(CultureInfo.InvariantCulture, text, arg_1)), null);
            }
            arg_0.cmethod_2014("$id", false);
            arg_0.kmethod_2037(text);
        }
예제 #8
0
        // Token: 0x06000C25 RID: 3109 RVA: 0x00043BDC File Offset: 0x00041DDC
        private void lmethod_2188(Class_296 arg_0, Regex arg_1, Class_418 arg_2)
        {
            Class_441 class_ = arg_2.prop_14 as Class_441;

            arg_0.kmethod_2007();
            arg_0.gmethod_2013((class_ != null) ? class_.smethod_3590("Pattern") : "Pattern");
            arg_0.kmethod_2037(arg_1.ToString());
            arg_0.gmethod_2013((class_ != null) ? class_.smethod_3590("Options") : "Options");
            arg_2.kmethod_3177(arg_0, arg_1.Options);
            arg_0.lmethod_2008();
        }
예제 #9
0
        // Token: 0x0600154B RID: 5451 RVA: 0x00065714 File Offset: 0x00063914
        private void xmethod_3911(Class_296 arg_0, object obje_0)
        {
            string text = this.tmethod_3912(arg_0, obje_0);

            if (this.field_4 != null && this.field_4.prop_0 >= TraceLevel.Info)
            {
                this.field_4.gmethod_2303(TraceLevel.Info, Class_326.FormatMessage(null, arg_0.prop_4, "Writing object reference to Id '{0}' for {1}.".FormatWith(CultureInfo.InvariantCulture, text, obje_0.GetType())), null);
            }
            arg_0.kmethod_2007();
            arg_0.cmethod_2014("$ref", false);
            arg_0.kmethod_2037(text);
            arg_0.lmethod_2008();
        }
예제 #10
0
 // Token: 0x06000C33 RID: 3123 RVA: 0x0004406F File Offset: 0x0004226F
 public virtual void smethod_2200(Class_296 arg_0, object obje_0, Class_418 arg_1)
 {
     if (obje_0 == null)
     {
         arg_0.gmethod_2033();
         return;
     }
     if (obje_0 is Version)
     {
         arg_0.kmethod_2037(obje_0.ToString());
         return;
     }
     throw new Class_417("Expected Version object value");
 }
예제 #11
0
        // Token: 0x06001386 RID: 4998 RVA: 0x0005C14C File Offset: 0x0005A34C
        private void dmethod_3536(string str_0, Class_296 arg_0, Class_463 arg_1)
        {
            IList <Class_463> list;

            if (Enum.IsDefined(typeof(Class_463), arg_1))
            {
                list = new List <Class_463>
                {
                    arg_1
                };
            }
            else
            {
                IEnumerable <Class_463> flagsValues = Class_505.GetFlagsValues <Class_463>(arg_1);
                if (Class_436.field_2 == null)
                {
                    Class_436.field_2 = new Func <Class_463, bool>(Class_436.lmethod_3538);
                }
                list = flagsValues.Where(Class_436.field_2).ToList <Class_463>();
            }
            if (list.Count == 0)
            {
                return;
            }
            arg_0.gmethod_2013(str_0);
            if (list.Count == 1)
            {
                arg_0.kmethod_2037(Class_460.gmethod_3803(list[0]));
                return;
            }
            arg_0.pmethod_2009();
            foreach (Class_463 arg_2 in list)
            {
                arg_0.kmethod_2037(Class_460.gmethod_3803(arg_2));
            }
            arg_0.smethod_2010();
        }
예제 #12
0
        // Token: 0x06000C30 RID: 3120 RVA: 0x00043EAC File Offset: 0x000420AC
        public virtual void kmethod_2197(Class_296 arg_0, object obje_0, Class_418 arg_1)
        {
            if (obje_0 == null)
            {
                arg_0.gmethod_2033();
                return;
            }
            Enum   @enum = (Enum)obje_0;
            string text  = @enum.ToString("G");

            if (char.IsNumber(text[0]) || text[0] == '-')
            {
                arg_0.cmethod_2074(obje_0);
                return;
            }
            Type   type = @enum.GetType();
            string str_ = Class_505.ToEnumName(type, text, this.prop_0);

            arg_0.kmethod_2037(str_);
        }
예제 #13
0
        // Token: 0x06001030 RID: 4144 RVA: 0x00050F3C File Offset: 0x0004F13C
        private void kmethod_2967(Class_296 arg_0, Class_387 arg_1, XmlNamespaceManager arg_2, bool bool_0)
        {
            Func <Class_387, bool> func = null;

            Class_407.NClass_0 nclass_ = new Class_407.NClass_0();
            nclass_.field_1 = arg_1;
            switch (nclass_.field_1.prop_0)
            {
            case XmlNodeType.Element:
                if (this.vmethod_2965(nclass_.field_1))
                {
                    IEnumerable <Class_387> source = nclass_.field_1.prop_2;
                    if (func == null)
                    {
                        func = new Func <Class_387, bool>(nclass_.nmethod_1);
                    }
                    if (source.All(func) && nclass_.field_1.prop_2.Count > 0)
                    {
                        this.dmethod_2966(arg_0, nclass_.field_1, arg_2, false);
                        return;
                    }
                }
                arg_2.PushScope();
                foreach (Class_387 class_ in nclass_.field_1.prop_3)
                {
                    if (class_.prop_6 == "http://www.w3.org/2000/xmlns/")
                    {
                        string prefix = (class_.prop_1 != "xmlns") ? class_.prop_1 : string.Empty;
                        string uri    = class_.prop_5;
                        arg_2.AddNamespace(prefix, uri);
                    }
                }
                if (bool_0)
                {
                    arg_0.gmethod_2013(this.cmethod_2964(nclass_.field_1, arg_2));
                }
                if (!this.smethod_2980(nclass_.field_1.prop_3).Any <Class_387>() && nclass_.field_1.prop_2.Count == 1 && nclass_.field_1.prop_2[0].prop_0 == XmlNodeType.Text)
                {
                    arg_0.kmethod_2037(nclass_.field_1.prop_2[0].prop_5);
                }
                else if (nclass_.field_1.prop_2.Count == 0 && Class_510.IsNullOrEmpty <Class_387>(nclass_.field_1.prop_3))
                {
                    Class_391 class_2 = (Class_391)nclass_.field_1;
                    if (class_2.prop_0)
                    {
                        arg_0.gmethod_2033();
                    }
                    else
                    {
                        arg_0.kmethod_2037(string.Empty);
                    }
                }
                else
                {
                    arg_0.kmethod_2007();
                    for (int i = 0; i < nclass_.field_1.prop_3.Count; i++)
                    {
                        this.kmethod_2967(arg_0, nclass_.field_1.prop_3[i], arg_2, true);
                    }
                    this.dmethod_2966(arg_0, nclass_.field_1, arg_2, true);
                    arg_0.lmethod_2008();
                }
                arg_2.PopScope();
                return;

            case XmlNodeType.Attribute:
            case XmlNodeType.Text:
            case XmlNodeType.CDATA:
            case XmlNodeType.ProcessingInstruction:
            case XmlNodeType.Whitespace:
            case XmlNodeType.SignificantWhitespace:
                if (nclass_.field_1.prop_6 == "http://www.w3.org/2000/xmlns/" && nclass_.field_1.prop_5 == "http://james.newtonking.com/projects/json")
                {
                    return;
                }
                if (nclass_.field_1.prop_6 == "http://james.newtonking.com/projects/json" && nclass_.field_1.prop_1 == "Array")
                {
                    return;
                }
                if (bool_0)
                {
                    arg_0.gmethod_2013(this.cmethod_2964(nclass_.field_1, arg_2));
                }
                arg_0.kmethod_2037(nclass_.field_1.prop_5);
                return;

            case XmlNodeType.Comment:
                if (bool_0)
                {
                    arg_0.vmethod_2075(nclass_.field_1.prop_5);
                    return;
                }
                return;

            case XmlNodeType.Document:
            case XmlNodeType.DocumentFragment:
                this.dmethod_2966(arg_0, nclass_.field_1, arg_2, bool_0);
                return;

            case XmlNodeType.DocumentType:
            {
                Class_395 class_3 = (Class_395)nclass_.field_1;
                arg_0.gmethod_2013(this.cmethod_2964(nclass_.field_1, arg_2));
                arg_0.kmethod_2007();
                if (!string.IsNullOrEmpty(class_3.prop_0))
                {
                    arg_0.gmethod_2013("@name");
                    arg_0.kmethod_2037(class_3.prop_0);
                }
                if (!string.IsNullOrEmpty(class_3.prop_2))
                {
                    arg_0.gmethod_2013("@public");
                    arg_0.kmethod_2037(class_3.prop_2);
                }
                if (!string.IsNullOrEmpty(class_3.prop_1))
                {
                    arg_0.gmethod_2013("@system");
                    arg_0.kmethod_2037(class_3.prop_1);
                }
                if (!string.IsNullOrEmpty(class_3.prop_3))
                {
                    arg_0.gmethod_2013("@internalSubset");
                    arg_0.kmethod_2037(class_3.prop_3);
                }
                arg_0.lmethod_2008();
                return;
            }

            case XmlNodeType.XmlDeclaration:
            {
                Class_393 class_4 = (Class_393)nclass_.field_1;
                arg_0.gmethod_2013(this.cmethod_2964(nclass_.field_1, arg_2));
                arg_0.kmethod_2007();
                if (!string.IsNullOrEmpty(class_4.prop_0))
                {
                    arg_0.gmethod_2013("@version");
                    arg_0.kmethod_2037(class_4.prop_0);
                }
                if (!string.IsNullOrEmpty(class_4.prop_1))
                {
                    arg_0.gmethod_2013("@encoding");
                    arg_0.kmethod_2037(class_4.prop_1);
                }
                if (!string.IsNullOrEmpty(class_4.prop_2))
                {
                    arg_0.gmethod_2013("@standalone");
                    arg_0.kmethod_2037(class_4.prop_2);
                }
                arg_0.lmethod_2008();
                return;
            }
            }
            throw new Class_417("Unexpected XmlNodeType when serializing nodes: " + nclass_.field_1.prop_0);
        }
예제 #14
0
        // Token: 0x06000E7C RID: 3708 RVA: 0x0004CCD0 File Offset: 0x0004AED0
        public virtual void cmethod_2604(Class_296 arg_0, params Class_299[] arg_1)
        {
            if (arg_1 != null && arg_1.Length > 0 && this.field_1 != null)
            {
                Class_299 class_ = Class_418.xmethod_3181(arg_1, this.field_1.GetType());
                if (class_ != null && class_.prop_1)
                {
                    class_.tmethod_2132(arg_0, this.field_1, Class_418.xmethod_3161());
                    return;
                }
            }
            switch (this.field_0)
            {
            case Class_428.Comment:
                arg_0.vmethod_2075((this.field_1 != null) ? this.field_1.ToString() : null);
                return;

            case Class_428.Integer:
                if (this.field_1 is BigInteger)
                {
                    arg_0.cmethod_2074((BigInteger)this.field_1);
                    return;
                }
                arg_0.smethod_2040(Convert.ToInt64(this.field_1, CultureInfo.InvariantCulture));
                return;

            case Class_428.Float:
                if (this.field_1 is decimal)
                {
                    arg_0.smethod_2050((decimal)this.field_1);
                    return;
                }
                if (this.field_1 is double)
                {
                    arg_0.gmethod_2043((double)this.field_1);
                    return;
                }
                if (this.field_1 is float)
                {
                    arg_0.tmethod_2042((float)this.field_1);
                    return;
                }
                arg_0.gmethod_2043(Convert.ToDouble(this.field_1, CultureInfo.InvariantCulture));
                return;

            case Class_428.String:
                arg_0.kmethod_2037((this.field_1 != null) ? this.field_1.ToString() : null);
                return;

            case Class_428.Boolean:
                arg_0.cmethod_2044(Convert.ToBoolean(this.field_1, CultureInfo.InvariantCulture));
                return;

            case Class_428.Null:
                arg_0.gmethod_2033();
                return;

            case Class_428.Undefined:
                arg_0.cmethod_2034();
                return;

            case Class_428.Date:
                if (this.field_1 is DateTimeOffset)
                {
                    arg_0.tmethod_2052((DateTimeOffset)this.field_1);
                    return;
                }
                arg_0.xmethod_2051(Convert.ToDateTime(this.field_1, CultureInfo.InvariantCulture));
                return;

            case Class_428.Raw:
                arg_0.dmethod_2036((this.field_1 != null) ? this.field_1.ToString() : null);
                return;

            case Class_428.Bytes:
                arg_0.tmethod_2072((byte[])this.field_1);
                return;

            case Class_428.Guid:
            case Class_428.Uri:
            case Class_428.TimeSpan:
                arg_0.kmethod_2037((this.field_1 != null) ? this.field_1.ToString() : null);
                return;

            default:
                throw Class_513.CreateArgumentOutOfRangeException("TokenType", this.field_0, "Unexpected token type.");
            }
        }