Exemple #1
0
        protected override void WriteEnd(JsonToken token)
        {
            switch (token)
            {
            case JsonToken.EndObject:
                this._writer.Write('}');
                break;

            case JsonToken.EndArray:
                this._writer.Write(']');
                break;

            case JsonToken.EndConstructor:
                this._writer.Write(')');
                break;

            default:
                throw JsonWriterException.Create((JsonWriter)this, "Invalid JsonToken: " + (object)token, (Exception)null);
            }
        }
Exemple #2
0
        private void WriteEnd(JsonContainerType type)
        {
            switch (type)
            {
            case JsonContainerType.Object:
                this.WriteEndObject();
                break;

            case JsonContainerType.Array:
                this.WriteEndArray();
                break;

            case JsonContainerType.Constructor:
                this.WriteEndConstructor();
                break;

            default:
                throw JsonWriterException.Create(this, "Unexpected type when writing end: " + (object)type,
                                                 (Exception)null);
            }
        }