/// <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);
        }
Example #3
0
 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);
 }
Example #5
0
 void IJSonWritable.Write(IJSonWriter output)
 {
     output.Write(_data);
 }
 /// <summary>
 /// Write as JSON.
 /// </summary>
 public void Write(IJSonWriter output)
 {
     // write as an object (as _data implements IDictionary interface):
     output.Write(_data);
 }
 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();
        }
 protected override void WriteOptionalFields(IJSonWriter output)
 {
     output.WriteMember("data");
     output.Write(EventData);
 }
Example #10
0
 protected override void WriteOptionalFields(IJSonWriter output)
 {
     output.WriteMember("data");
     output.Write(EventData);
 }