protected override void WriteOptionalFields(IJSonWriter output) { // create basic JSON representation of Bayeux message: // { // ... - parent inserted fields // supportedConnectionTypes: "xxx", // version: "1.0", // minimumVersion: "1.0", // ext: "xxx" // } if (Version != null) { output.WriteMember("version", Version.ToString()); } if (MinimumVersion != null) { output.WriteMember("minimumVersion", MinimumVersion.ToString()); } output.WriteMember("supportedConnectionTypes"); output.WriteArrayBegin(); foreach (string type in BayeuxConnectionTypesHelper.ToCollection(SupportedConnectionTypes)) { output.WriteValue(type); } output.WriteArrayEnd(); }
public void Write(IJSonWriter output) { var reader = new JSonReader(); var tree = reader.Read(obj.ToString()); output.Write(tree); }
/// <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 ArrayWriter(IJSonWriter output) { if (output == null) throw new ArgumentNullException("output"); _output = output; GC.SuppressFinalize(this); }
protected override void WriteOptionalFields(IJSonWriter output) { output.WriteMember("supportedConnectionTypes"); output.WriteArrayBegin(); foreach (string type in BayeuxConnectionTypesHelper.ToCollection(SupportedConnectionTypes)) output.WriteValue(type); output.WriteArrayEnd(); }
/// <summary> /// Serializes an object as a JSON formatted string. /// </summary> public void Write(IJSonWriter output) { output.WriteObjectBegin(); { output.WriteMember("user", UserName); output.WriteMember("credentials", Password); } output.WriteObjectEnd(); }
public void Write(IJSonWriter output) { output.WriteObjectBegin(); output.WriteMember("ID", ID); output.WriteMember("Name", Name); output.WriteMember("Age", Age); output.WriteMember("Salary", Salary); output.WriteObjectEnd(); }
/// <summary> /// Writes JSON representation of this object. /// </summary> public void Write(IJSonWriter output) { output.WriteObjectBegin(); { output.WriteMember("reconnect", ToString(Reconnect)); output.WriteMember("interval", Interval); } output.WriteObjectEnd(); }
/// <summary> /// Serializes an object as a JSON formatted string. /// </summary> public void Write(IJSonWriter output) { output.WriteObjectBegin(); { output.WriteMember("user", UserName); output.WriteMember("credentials", Password); } output.WriteObjectEnd(); }
public ObjectWriter(IJSonWriter output) { if (output == null) { throw new ArgumentNullException("output"); } _output = output; GC.SuppressFinalize(this); }
protected override void WriteOptionalFields(IJSonWriter output) { output.WriteMember("supportedConnectionTypes"); output.WriteArrayBegin(); foreach (string type in BayeuxConnectionTypesHelper.ToCollection(SupportedConnectionTypes)) { output.WriteValue(type); } output.WriteArrayEnd(); }
/// <summary> /// Serializes an object as a JSON formatted string. /// </summary> public void Write(IJSonWriter output) { output.WriteObjectBegin(); { if (Credentials != null) { output.WriteMember("authentication"); Credentials.Write(output); } } output.WriteObjectEnd(); }
/// <summary> /// Serializes an object as a JSON formatted string. /// </summary> public void Write(IJSonWriter output) { output.WriteObjectBegin(); { if (Credentials != null) { output.WriteMember("authentication"); Credentials.Write(output); } } output.WriteObjectEnd(); }
/// <summary> /// Writes content of this object to a JSON stream. /// </summary> public void Write(IJSonWriter output) { if (output == null) { return; } // create basic JSON representation of Bayeux message: // { // channel: "xxx", // clientId: "xxx", // id: "xxx", // ... - optional data inserted by child classes // } output.WriteObjectBegin(); { output.WriteMember("channel", Channel); if (ClientID != null) { output.WriteMember("clientId", ClientID); } if (ID != null) { output.WriteMember("id", ID); } // write basic Bayeux request data field: if (HasData) { output.WriteMember("data"); _data.Write(output); } // write additional (optional) request fields: WriteOptionalFields(output); // write the data extension: if (HasExt) { output.WriteMember("ext"); _ext.Write(output); } } output.WriteObjectEnd(); }
protected override void WriteOptionalFields(IJSonWriter output) { // create basic JSON representation of Bayeux message: // { // ... - parent inserted fields // supportedConnectionTypes: "xxx", // version: "1.0", // minimumVersion: "1.0", // ext: "xxx" // } if (Version != null) output.WriteMember("version", Version.ToString()); if (MinimumVersion != null) output.WriteMember("minimumVersion", MinimumVersion.ToString()); output.WriteMember("supportedConnectionTypes"); output.WriteArrayBegin(); foreach (string type in BayeuxConnectionTypesHelper.ToCollection(SupportedConnectionTypes)) output.WriteValue(type); output.WriteArrayEnd(); }
void IJSonWritable.Write(IJSonWriter output) { // writes current decimal value as boolean: output.WriteValue(_data); }
/// <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.WriteValue(_data); }
/// <summary> /// Writes content of this object to a JSON stream. /// </summary> public void Write(IJSonWriter output) { if (output == null) return; // create basic JSON representation of Bayeux message: // { // channel: "xxx", // clientId: "xxx", // id: "xxx", // ... - optional data inserted by child classes // } output.WriteObjectBegin(); { output.WriteMember("channel", Channel); if (ClientID != null) output.WriteMember("clientId", ClientID); if (ID != null) output.WriteMember("id", ID); // write basic Bayeux request data field: if (HasData) { output.WriteMember("data"); _data.Write(output); } // write additional (optional) request fields: WriteOptionalFields(output); // write the data extension: if (HasExt) { output.WriteMember("ext"); _ext.Write(output); } } output.WriteObjectEnd(); }
protected override void WriteOptionalFields(IJSonWriter output) { output.WriteMember("connectionType", BayeuxConnectionTypesHelper.ToString(ConnectionType)); }
void IJSonWritable.Write(IJSonWriter output) { // writes current decimal value as boolean: output.WriteValue(_data); }
/// <summary> /// Writes additional data associated with this request, that is option for most of them. /// </summary> protected virtual void WriteOptionalFields(IJSonWriter output) { }
protected override void WriteOptionalFields(IJSonWriter output) { output.WriteMember("subscription", SubscriptionChannel); }
protected override void WriteOptionalFields(IJSonWriter output) { output.WriteMember("data"); output.Write(EventData); }
/// <summary> /// Writes JSON representation of this object. /// </summary> public void Write(IJSonWriter output) { output.WriteObjectBegin(); { output.WriteMember("reconnect", ToString(Reconnect)); output.WriteMember("interval", Interval); } output.WriteObjectEnd(); }
protected override void WriteOptionalFields(IJSonWriter output) { output.WriteMember("connectionType", BayeuxConnectionTypesHelper.ToString(ConnectionType)); }
/// <summary> /// Write as JSON. /// </summary> public void Write(IJSonWriter output) { // write as an object (as _data implements IDictionary interface): output.Write(_data); }
protected override void WriteOptionalFields(IJSonWriter output) { output.WriteMember("data"); output.Write(EventData); }
public void Write(IJSonWriter output) { var reader = new JSonReader(); var tree = reader.Read(obj.ToString()); output.Write(tree); }
void IJSonWritable.Write(IJSonWriter output) { output.WriteValue(_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("subscription", SubscriptionChannel); }
/// <summary> /// Writes additional fields related to this response. /// </summary> protected virtual void WriteOptionalFields(IJSonWriter output) { }