Exemplo n.º 1
0
        // Token: 0x060012BB RID: 4795 RVA: 0x0005A048 File Offset: 0x00058248
        private Class_508?gmethod_3383(Class_420 arg_0)
        {
            switch (arg_0.prop_3)
            {
            case Class_428.Object:
                return(new Class_508?(Class_508.EndObject));

            case Class_428.Array:
                return(new Class_508?(Class_508.EndArray));

            case Class_428.Constructor:
                return(new Class_508?(Class_508.EndConstructor));

            case Class_428.Property:
                return(null);

            default:
                throw Class_513.CreateArgumentOutOfRangeException("Type", arg_0.prop_3, "Unexpected JContainer type.");
            }
        }
Exemplo n.º 2
0
        // Token: 0x060012BE RID: 4798 RVA: 0x0005A138 File Offset: 0x00058338
        private void dmethod_3386(Class_361 arg_0)
        {
            switch (arg_0.prop_3)
            {
            case Class_428.Object:
                base.xmethod_1901(Class_508.StartObject);
                return;

            case Class_428.Array:
                base.xmethod_1901(Class_508.StartArray);
                return;

            case Class_428.Constructor:
                base.tmethod_1902(Class_508.StartConstructor, ((Class_421)arg_0).prop_1);
                return;

            case Class_428.Property:
                base.tmethod_1902(Class_508.PropertyName, ((Class_427)arg_0).prop_1);
                return;

            case Class_428.Comment:
                base.tmethod_1902(Class_508.Comment, ((Class_362)arg_0).prop_2);
                return;

            case Class_428.Integer:
                base.tmethod_1902(Class_508.Integer, ((Class_362)arg_0).prop_2);
                return;

            case Class_428.Float:
                base.tmethod_1902(Class_508.Float, ((Class_362)arg_0).prop_2);
                return;

            case Class_428.String:
                base.tmethod_1902(Class_508.String, ((Class_362)arg_0).prop_2);
                return;

            case Class_428.Boolean:
                base.tmethod_1902(Class_508.Boolean, ((Class_362)arg_0).prop_2);
                return;

            case Class_428.Null:
                base.tmethod_1902(Class_508.Null, ((Class_362)arg_0).prop_2);
                return;

            case Class_428.Undefined:
                base.tmethod_1902(Class_508.Undefined, ((Class_362)arg_0).prop_2);
                return;

            case Class_428.Date:
                base.tmethod_1902(Class_508.Date, ((Class_362)arg_0).prop_2);
                return;

            case Class_428.Raw:
                base.tmethod_1902(Class_508.Raw, ((Class_362)arg_0).prop_2);
                return;

            case Class_428.Bytes:
                base.tmethod_1902(Class_508.Bytes, ((Class_362)arg_0).prop_2);
                return;

            case Class_428.Guid:
                base.tmethod_1902(Class_508.String, this.kmethod_3387(((Class_362)arg_0).prop_2));
                return;

            case Class_428.Uri:
                base.tmethod_1902(Class_508.String, this.kmethod_3387(((Class_362)arg_0).prop_2));
                return;

            case Class_428.TimeSpan:
                base.tmethod_1902(Class_508.String, this.kmethod_3387(((Class_362)arg_0).prop_2));
                return;

            default:
                throw Class_513.CreateArgumentOutOfRangeException("Type", arg_0.prop_3, "Unexpected JTokenType.");
            }
        }
Exemplo n.º 3
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.");
            }
        }
Exemplo n.º 4
0
        // Token: 0x06000E6F RID: 3695 RVA: 0x0004C254 File Offset: 0x0004A454
        internal static int xmethod_2591(Class_428 arg_0, object obje_0, object obje_1)
        {
            if (obje_0 == null && obje_1 == null)
            {
                return(0);
            }
            if (obje_0 != null && obje_1 == null)
            {
                return(1);
            }
            if (obje_0 == null && obje_1 != null)
            {
                return(-1);
            }
            switch (arg_0)
            {
            case Class_428.Comment:
            case Class_428.String:
            case Class_428.Raw:
            {
                string strA = Convert.ToString(obje_0, CultureInfo.InvariantCulture);
                string strB = Convert.ToString(obje_1, CultureInfo.InvariantCulture);
                return(string.CompareOrdinal(strA, strB));
            }

            case Class_428.Integer:
                if (obje_0 is BigInteger)
                {
                    return(Class_362.smethod_2590((BigInteger)obje_0, obje_1));
                }
                if (obje_1 is BigInteger)
                {
                    return(-Class_362.smethod_2590((BigInteger)obje_1, obje_0));
                }
                if (obje_0 is ulong || obje_1 is ulong || obje_0 is decimal || obje_1 is decimal)
                {
                    return(Convert.ToDecimal(obje_0, CultureInfo.InvariantCulture).CompareTo(Convert.ToDecimal(obje_1, CultureInfo.InvariantCulture)));
                }
                if (obje_0 is float || obje_1 is float || obje_0 is double || obje_1 is double)
                {
                    return(Class_362.tmethod_2592(obje_0, obje_1));
                }
                return(Convert.ToInt64(obje_0, CultureInfo.InvariantCulture).CompareTo(Convert.ToInt64(obje_1, CultureInfo.InvariantCulture)));

            case Class_428.Float:
                if (obje_0 is BigInteger)
                {
                    return(Class_362.smethod_2590((BigInteger)obje_0, obje_1));
                }
                if (obje_1 is BigInteger)
                {
                    return(-Class_362.smethod_2590((BigInteger)obje_1, obje_0));
                }
                return(Class_362.tmethod_2592(obje_0, obje_1));

            case Class_428.Boolean:
            {
                bool flag  = Convert.ToBoolean(obje_0, CultureInfo.InvariantCulture);
                bool value = Convert.ToBoolean(obje_1, CultureInfo.InvariantCulture);
                return(flag.CompareTo(value));
            }

            case Class_428.Date:
            {
                if (obje_0 is DateTime)
                {
                    DateTime dateTime = (DateTime)obje_0;
                    DateTime value2;
                    if (obje_1 is DateTimeOffset)
                    {
                        value2 = ((DateTimeOffset)obje_1).DateTime;
                    }
                    else
                    {
                        value2 = Convert.ToDateTime(obje_1, CultureInfo.InvariantCulture);
                    }
                    return(dateTime.CompareTo(value2));
                }
                DateTimeOffset dateTimeOffset = (DateTimeOffset)obje_0;
                DateTimeOffset other;
                if (obje_1 is DateTimeOffset)
                {
                    other = (DateTimeOffset)obje_1;
                }
                else
                {
                    other = new DateTimeOffset(Convert.ToDateTime(obje_1, CultureInfo.InvariantCulture));
                }
                return(dateTimeOffset.CompareTo(other));
            }

            case Class_428.Bytes:
            {
                if (!(obje_1 is byte[]))
                {
                    throw new ArgumentException("Object must be of type byte[].");
                }
                byte[] array  = obje_0 as byte[];
                byte[] array2 = obje_1 as byte[];
                if (array == null)
                {
                    return(-1);
                }
                if (array2 == null)
                {
                    return(1);
                }
                return(Class_513.ByteArrayCompare(array, array2));
            }

            case Class_428.Guid:
            {
                if (!(obje_1 is Guid))
                {
                    throw new ArgumentException("Object must be of type Guid.");
                }
                Guid guid   = (Guid)obje_0;
                Guid value3 = (Guid)obje_1;
                return(guid.CompareTo(value3));
            }

            case Class_428.Uri:
            {
                if (!(obje_1 is Uri))
                {
                    throw new ArgumentException("Object must be of type Uri.");
                }
                Uri uri  = (Uri)obje_0;
                Uri uri2 = (Uri)obje_1;
                return(Comparer <string> .Default.Compare(uri.ToString(), uri2.ToString()));
            }

            case Class_428.TimeSpan:
            {
                if (!(obje_1 is TimeSpan))
                {
                    throw new ArgumentException("Object must be of type TimeSpan.");
                }
                TimeSpan timeSpan = (TimeSpan)obje_0;
                TimeSpan value4   = (TimeSpan)obje_1;
                return(timeSpan.CompareTo(value4));
            }
            }
            throw Class_513.CreateArgumentOutOfRangeException("valueType", arg_0, "Unexpected value type: {0}".FormatWith(CultureInfo.InvariantCulture, arg_0));
        }