Exemplo n.º 1
0
        /// <summary>
        /// Writes the contents of this Json type using the specified
        /// <see cref="Vlad2Net.Json.IJsWriter"/>.
        /// </summary>
        /// <param name="writer">The Json writer.</param>
        public override void Write(IJsWriter writer)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }

            writer.WriteValue(ToString());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Writes the contents of this Json type using the specified
        /// <see cref="Vlad2Net.Json.IJsWriter"/>.
        /// </summary>
        /// <param name="writer">The Json writer.</param>
        public override void Write(IJsWriter writer)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }

            writer.WriteValue(this.EncodedValue);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Writes the contents of this Json type using the specified
        /// <see cref="Vlad2Net.Json.IJsWriter"/>.
        /// </summary>
        /// <param name="writer">The Json writer.</param>
        public void Write(IJsWriter writer)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }

            writer.WriteBeginArray();
            foreach (IJsType jt in this)
            {
                jt.Write(writer);
            }
            writer.WriteEndArray();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Writes the contents of this Json type using the specified
        /// <see cref="Vlad2Net.Json.IJsWriter"/>.
        /// </summary>
        /// <param name="writer">The Json writer.</param>
        public void Write(IJsWriter writer)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }

            writer.WriteBeginObject();
            foreach (KeyValuePair <string, IJsType> pair in this)
            {
                writer.WriteName(pair.Key);
                pair.Value.Write(writer);
            }
            writer.WriteEndObject();
        }
Exemplo n.º 5
0
 /// <summary>
 /// When overriden in a derived class; writes the contents of the Json type
 /// to the specified <see cref="Vlad2Net.Json.IJsWriter"/>.
 /// </summary>
 /// <param name="writer">The Json writer.</param>
 public abstract void Write(IJsWriter writer);