/// <summary> /// Writes content of this object to a JSON stream. /// </summary> public void Write(IJSonWriter output) { if (output == null) { return; } output.WriteObjectBegin(); { output.WriteMember("channel", Channel); if (ID != null) { output.WriteMember("id", ID); } output.WriteMember("clientId", ClientID); output.WriteMember("successful", Successful ? 1 : 0); if (Data != null) { output.WriteMember("data"); output.Write(Data); } if (Ext != null) { output.WriteMember("ext"); output.Write(Ext); } // writes additional members defined by child classes: WriteOptionalFields(output); } output.WriteObjectEnd(); }
public void Write(IJSonWriter output) { var reader = new JSonReader(); var tree = reader.Read(obj.ToString()); output.Write(tree); }
public void Write(IEnumerable array) { _output.Write(array); }
/// <summary> /// Write as JSON. /// </summary> public void Write(IJSonWriter output) { // write as an object (as _data implements IDictionary interface): output.Write(_data); }
void IJSonWritable.Write(IJSonWriter output) { output.Write(_data); }
/// <summary> /// Writes content of this object to a JSON stream. /// </summary> public void Write(IJSonWriter output) { if (output == null) return; output.WriteObjectBegin(); { output.WriteMember("channel", Channel); if (ID != null) output.WriteMember("id", ID); output.WriteMember("clientId", ClientID); output.WriteMember("successful", Successful ? 1 : 0); if (Data != null) { output.WriteMember("data"); output.Write(Data); } if (Ext != null) { output.WriteMember("ext"); output.Write(Ext); } // writes additional members defined by child classes: WriteOptionalFields(output); } output.WriteObjectEnd(); }
protected override void WriteOptionalFields(IJSonWriter output) { output.WriteMember("data"); output.Write(EventData); }