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

Deserialize() public static method

public static Deserialize ( string json ) : DataPacket
json string
return Mycroft.Messages.DataPacket
        public static new DataPacket Deserialize(string json)
        {
            try
            {
                var ret = new MsgBroadcast();
                dynamic obj = Json.Decode(json);
                ret.Id = obj["id"];
                if (ret.Id == null)
                    throw new ParseException(json, "No id was supplied");
                ret.Content = obj["content"];
                if (ret.Content == null)
                    throw new ParseException(json, "No content was supplied");
                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");
            }
        }