Exemple #1
0
        public ArgSetting Get(string key, string defValue)
        {
            ArgSetting s = Get(key);

            if (s != null)
            {
                return(s);
            }
            return(Set(new ArgSetting(key, defValue)));
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #4
0
 public string KeyOf(ArgSetting value)
 {
     return(KeyOf(value.Key));
 }