private string RowDataToJson(RowData data) { JObject jObject = new JObject(); foreach (KeyValuePair <string, string> pair in data) { jObject[pair.Key] = pair.Value; } return(jObject.ToString()); }
private RowData JsonToRowData(string json) { RowData data = new RowData(); JObject jObject = (JObject)JsonConvert.DeserializeObject(json); foreach (KeyValuePair <string, JToken> pair in jObject) { data[pair.Key] = pair.Value.ToString(); } return(data); }
private void OnRemoveRowData(string uid, RowData row_data) { foreach (KeyValuePair <string, string> pair in row_data) { if (this.index_map.ContainsKey(pair.Key)) { if (this.index_map[pair.Key].ContainsKey(pair.Value)) { this.index_map[pair.Key][pair.Value].Remove(uid); } } } }
private void OnAddRowData(string uid, RowData row_data) { foreach (KeyValuePair <string, string> pair in row_data) { if (this.index_map.ContainsKey(pair.Key)) { if (!this.index_map[pair.Key].ContainsKey(pair.Value)) { this.index_map[pair.Key][pair.Value] = new List <string>(); } this.index_map[pair.Key][pair.Value].Add(uid); } } }