public bool SetJsonMessage(string message) { try { JObject jo = JsonConvert.DeserializeObject <JObject>(message); if (jo != null && jo.HasValues) { var pairs = jo.GetEnumerator(); while (pairs.MoveNext()) { if (string.Equals(pairs.Current.Key, DicKeys.dataTable)) { setJsonTable((JObject)pairs.Current.Value); } else //if (pairs.Current.Value != null) { Propertites.Add(pairs.Current.Key, (string)pairs.Current.Value); } } return(true); } else { return(false); } } catch (Exception e) { return(false); } }
public void AddProperty(string key, string value) { if (Propertites.ContainsKey(key)) { Propertites.Remove(key); } Propertites.Add(key, value); }