Exemplo n.º 1
0
        public ArgSetting Get(string key, string defValue)
        {
            ArgSetting s = Get(key);

            if (s != null)
            {
                return(s);
            }
            return(Set(new ArgSetting(key, defValue)));
        }
Exemplo n.º 2
0
        public ArgSetting Set(ArgSetting setting)
        {
            string key = KeyOf(setting);

            if (string.IsNullOrEmpty(key))
            {
                throw new ArgumentException("invalid key");
            }
            if (store.ContainsKey(key))
            {
                store.Remove(key);
            }
            store[key] = setting;
            return(setting);
        }
Exemplo n.º 3
0
        public ArgSetting Remove(string key)
        {
            if (string.IsNullOrEmpty(key))
            {
                throw new ArgumentException("invalid key");
            }
            string lowkey = KeyOf(key);

            if (store.ContainsKey(lowkey))
            {
                ArgSetting value = store[lowkey];
                store.Remove(lowkey);
                return(value);
            }
            return(null);
        }
Exemplo n.º 4
0
 public string KeyOf(ArgSetting value)
 {
     return(KeyOf(value.Key));
 }