Example #1
0
 public static new DataPacket Deserialize(string json)
 {
     try
     {
         var ret = new MsgQuerySuccess();
         dynamic obj = Json.Decode(json);
         ret.Id = obj["id"];
         if (ret.Id == null)
             throw new ParseException(json, "No id was supplied");
         ret.Ret = obj["ret"];
         return ret;
     }
     catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException)
     {
         throw new ParseException(json, "General binding exception. Was something invalid?");
     }
     catch (ArgumentException)
     {
         throw new ParseException(json, "Invalid JSON");
     }
 }
Example #2
0
 public Reply(String rawData, AppInstance instance)
 {
     this.msgQSuc = MsgQuerySuccess.Deserialize(rawData) as MsgQuerySuccess;
     this.instance = instance;
     msgQSuc.FromInstanceId = instance.InstanceId;
 }