Mycroft.Messages.Msg.MsgGeneralFailure.Serialize C# (CSharp) Method

Serialize() public method

public Serialize ( ) : string
return string
        public override string Serialize()
        {
            var dct = new Dictionary<string, object>();
            dct["received"] = Received;
            dct["message"] = Message;
            var obj = new DynamicJsonObject(dct);
            var writer = new StringWriter();
            Json.Write(obj, writer);
            return writer.ToString();
        }

Usage Example

Example #1
0
 /// <summary>
 /// Serialize this to exception to json as defined in Mycroft.Msg.MsgGeneralFailure.Serialize
 /// </summary>
 /// <returns>The JSON</returns>
 public string Serialize()
 {
     var msgFail = new Msg.MsgGeneralFailure();
     msgFail.Message = Message;
     msgFail.Received = Received;
     return msgFail.Serialize();
 }
All Usage Examples Of Mycroft.Messages.Msg.MsgGeneralFailure::Serialize
MsgGeneralFailure