/// <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()); }
/// <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); }
/// <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(); }
/// <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(); }
/// <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);