using EGFramework; using Newtonsoft.Json; namespace Emergency_platform{ public class ResponseNumericalValue : IResponse { public string action { set; get; } public string taskid { set; get; } public string halmet { set; get; } public string cabinetid { set; get; } public string targetname { set; get; } public bool TrySetData(string protocolData, byte[] protocolBytes) { try { ResponseNumericalValue data = JsonConvert.DeserializeObject(protocolData); if(data.action == "numericalValue"){ this.action = data.action; this.taskid = data.taskid; this.halmet = data.halmet; this.targetname = data.targetname; this.cabinetid = data.cabinetid; return true; } return false; } catch (System.Exception) { return false; throw; } } } }