Mycroft.Messages.Msg.MsgQuerySuccess.Deserialize C# (CSharp) Method

Deserialize() public static method

public static Deserialize ( string json ) : DataPacket
json string
return DataPacket
        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");
            }
        }