Esempio n. 1
0
        private string RowDataToJson(RowData data)
        {
            JObject jObject = new JObject();

            foreach (KeyValuePair <string, string> pair in data)
            {
                jObject[pair.Key] = pair.Value;
            }
            return(jObject.ToString());
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 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);
             }
         }
     }
 }
Esempio n. 4
0
 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);
         }
     }
 }