/// <summary> /// Writes the contents of this Json type using the specified /// <see cref="NetServ.Net.Json.IJsonWriter"/>. /// </summary> /// <param name="writer">The Json writer.</param> public void Write(IJsonWriter writer) { if (writer == null) { throw new ArgumentNullException("writer"); } writer.WriteBeginObject(); foreach (KeyValuePair <string, IJsonType> pair in this) { writer.WriteName(pair.Key); pair.Value.Write(writer); } writer.WriteEndObject(); }