Exemplo n.º 1
0
 public static object GetObject(this EasyDictionary <string, EasyObject> writer, string key)
 {
     if (writer.ToDictionary().ContainsKey(key))
     {
         return(writer.ToDictionary()[key].GetObject());
     }
     return(default(object));
 }
Exemplo n.º 2
0
 public static void SetObject(this EasyDictionary <string, EasyObject> writer, string key, object value)
 {
     if (HasKey(writer, key))
     {
         writer.ToDictionary()[key] = new EasyObject(value);
     }
     else
     {
         writer.ToDictionary().Add(key, new EasyObject(value));
     }
 }
Exemplo n.º 3
0
        public static void Clear(this EasyDictionary <string, EasyObject> writer)
        {
            var dic = writer.ToDictionary();

            if (dic != null)
            {
                dic.Clear();
                writer = new EasyDictionary <string, EasyObject>(dic);
            }
        }
Exemplo n.º 4
0
        public static void Remove(this EasyDictionary <string, EasyObject> writer, string key)
        {
            var dic = writer.ToDictionary();

            if (dic != null && dic.ContainsKey(key))
            {
                dic.Remove(key);
                writer = new EasyDictionary <string, EasyObject>(dic);
            }
        }
Exemplo n.º 5
0
 public static bool HasKey(this EasyDictionary <string, EasyObject> writer, string key)
 {
     return(writer.ToDictionary().ContainsKey(key));
 }