Esempio n. 1
0
        private JsonToken?method_16(JContainer jcontainer_0)
        {
            switch (jcontainer_0.Type)
            {
            case JTokenType.Object:
                return(13);

            case JTokenType.Array:
                return(14);

            case JTokenType.Constructor:
                return(15);

            case JTokenType.Property:
                return(null);
            }
            throw Class193.smethod_1("Type", jcontainer_0.Type, "Unexpected JContainer type.");
        }
Esempio n. 2
0
        internal void method_5(JsonReader jsonReader_0, int int_0, bool bool_1, bool bool_2)
        {
            do
            {
                switch (jsonReader_0.JsonToken_0)
                {
                case JsonToken.None:
                    break;

                case JsonToken.StartObject:
                    this.WriteStartObject();
                    break;

                case JsonToken.StartArray:
                    this.WriteStartArray();
                    break;

                case JsonToken.StartConstructor:
                {
                    string a = jsonReader_0.Object_0.ToString();
                    if (!bool_2 || !string.Equals(a, "Date", StringComparison.Ordinal))
                    {
                        this.WriteStartConstructor(jsonReader_0.Object_0.ToString());
                        break;
                    }
                    this.method_6(jsonReader_0);
                    break;
                }

                case JsonToken.PropertyName:
                    this.WritePropertyName(jsonReader_0.Object_0.ToString());
                    break;

                case JsonToken.Comment:
                    this.WriteComment((jsonReader_0.Object_0 != null) ? jsonReader_0.Object_0.ToString() : null);
                    break;

                case JsonToken.Raw:
                    this.WriteRawValue((jsonReader_0.Object_0 != null) ? jsonReader_0.Object_0.ToString() : null);
                    break;

                case JsonToken.Integer:
                    if (!(jsonReader_0.Object_0 is BigInteger))
                    {
                        this.WriteValue(Convert.ToInt64(jsonReader_0.Object_0, CultureInfo.InvariantCulture));
                        break;
                    }
                    this.WriteValue((BigInteger)jsonReader_0.Object_0);
                    break;

                case JsonToken.Float:
                {
                    object obj2 = jsonReader_0.Object_0;
                    if (!(obj2 is decimal))
                    {
                        if (obj2 is double)
                        {
                            this.WriteValue((double)obj2);
                        }
                        else if (obj2 is float)
                        {
                            this.WriteValue((float)obj2);
                        }
                        else
                        {
                            this.WriteValue(Convert.ToDouble(obj2, CultureInfo.InvariantCulture));
                        }
                        break;
                    }
                    this.WriteValue((decimal)obj2);
                    break;
                }

                case JsonToken.String:
                    this.WriteValue(jsonReader_0.Object_0.ToString());
                    break;

                case JsonToken.Boolean:
                    this.WriteValue(Convert.ToBoolean(jsonReader_0.Object_0, CultureInfo.InvariantCulture));
                    break;

                case JsonToken.Null:
                    this.WriteNull();
                    break;

                case JsonToken.Undefined:
                    this.WriteUndefined();
                    break;

                case JsonToken.EndObject:
                    this.WriteEndObject();
                    break;

                case JsonToken.EndArray:
                    this.WriteEndArray();
                    break;

                case JsonToken.EndConstructor:
                    this.WriteEndConstructor();
                    break;

                case JsonToken.Date:
                    if (!(jsonReader_0.Object_0 is DateTimeOffset))
                    {
                        this.WriteValue(Convert.ToDateTime(jsonReader_0.Object_0, CultureInfo.InvariantCulture));
                        break;
                    }
                    this.WriteValue((DateTimeOffset)jsonReader_0.Object_0);
                    break;

                case JsonToken.Bytes:
                    this.WriteValue((byte[])jsonReader_0.Object_0);
                    break;

                default:
                    throw Class193.smethod_1("TokenType", jsonReader_0.JsonToken_0, "Unexpected token type.");
                }
            }while ((((int_0 - 1) < (jsonReader_0.Int32_0 - (smethod_1(jsonReader_0.JsonToken_0) ? 1 : 0))) && bool_1) && jsonReader_0.Read());
        }
Esempio n. 3
0
        private void method_19(JToken jtoken_3)
        {
            switch (jtoken_3.Type)
            {
            case JTokenType.Object:
                base.SetToken(JsonToken.StartObject);
                return;

            case JTokenType.Array:
                base.SetToken(JsonToken.StartArray);
                return;

            case JTokenType.Constructor:
                base.SetToken(JsonToken.StartConstructor);
                return;

            case JTokenType.Property:
                base.SetToken(JsonToken.PropertyName, ((JProperty)jtoken_3).Name);
                return;

            case JTokenType.Comment:
                base.SetToken(JsonToken.Comment, ((JValue)jtoken_3).Value);
                return;

            case JTokenType.Integer:
                base.SetToken(JsonToken.Integer, ((JValue)jtoken_3).Value);
                return;

            case JTokenType.Float:
                base.SetToken(JsonToken.Float, ((JValue)jtoken_3).Value);
                return;

            case JTokenType.String:
                base.SetToken(JsonToken.String, ((JValue)jtoken_3).Value);
                return;

            case JTokenType.Boolean:
                base.SetToken(JsonToken.Boolean, ((JValue)jtoken_3).Value);
                return;

            case JTokenType.Null:
                base.SetToken(JsonToken.Null, ((JValue)jtoken_3).Value);
                return;

            case JTokenType.Undefined:
                base.SetToken(JsonToken.Undefined, ((JValue)jtoken_3).Value);
                return;

            case JTokenType.Date:
                base.SetToken(JsonToken.Date, ((JValue)jtoken_3).Value);
                return;

            case JTokenType.Raw:
                base.SetToken(JsonToken.Raw, ((JValue)jtoken_3).Value);
                return;

            case JTokenType.Bytes:
                base.SetToken(JsonToken.Bytes, ((JValue)jtoken_3).Value);
                return;

            case JTokenType.Guid:
                base.SetToken(JsonToken.String, this.method_20(((JValue)jtoken_3).Value));
                return;

            case JTokenType.Uri:
                base.SetToken(JsonToken.String, this.method_20(((JValue)jtoken_3).Value));
                return;

            case JTokenType.TimeSpan:
                base.SetToken(JsonToken.String, this.method_20(((JValue)jtoken_3).Value));
                return;
            }
            throw Class193.smethod_1("Type", jtoken_3.Type, "Unexpected JTokenType.");
        }