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