コード例 #1
0
        /// <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();
        }
コード例 #2
0
        public void Write(IJSonWriter output)
        {
            var reader = new JSonReader();
            var tree   = reader.Read(obj.ToString());

            output.Write(tree);
        }
コード例 #3
0
 public void Write(IEnumerable array)
 {
     _output.Write(array);
 }
コード例 #4
0
 /// <summary>
 /// Write as JSON.
 /// </summary>
 public void Write(IJSonWriter output)
 {
     // write as an object (as _data implements IDictionary interface):
     output.Write(_data);
 }
コード例 #5
0
ファイル: JSonArray.cs プロジェクト: coderhx/codetitans-libs
 void IJSonWritable.Write(IJSonWriter output)
 {
     output.Write(_data);
 }
コード例 #6
0
 /// <summary>
 /// Write as JSON.
 /// </summary>
 public void Write(IJSonWriter output)
 {
     // write as an object (as _data implements IDictionary interface):
     output.Write(_data);
 }
コード例 #7
0
 public void Write(IJSonWriter output)
 {
     var reader = new JSonReader();
     var tree = reader.Read(obj.ToString());
     output.Write(tree);
 }
コード例 #8
0
        /// <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();
        }
コード例 #9
0
 protected override void WriteOptionalFields(IJSonWriter output)
 {
     output.WriteMember("data");
     output.Write(EventData);
 }
コード例 #10
0
 protected override void WriteOptionalFields(IJSonWriter output)
 {
     output.WriteMember("data");
     output.Write(EventData);
 }