public T Get <T>(string name) { if (_settingsTable.ContainsKey(name)) { SettingsEntry <T> entry = (SettingsEntry <T>)_settingsTable[name]; return(entry.Value); } else { return(default(T)); } }
public bool TryGet <T>(string name, out T value) { value = default(T); if (_settingsTable.ContainsKey(name)) { SettingsEntry <T> entry = (SettingsEntry <T>)_settingsTable[name]; value = entry.Value; return(true); } return(false); }
public void Set <T>(string name, T value) { if (_settingsTable.ContainsKey(name)) { SettingsEntry <T> entry = (SettingsEntry <T>)_settingsTable[name]; entry.Value = value; } else { SettingsEntry <T> entry = new SettingsEntry <T>(default(T)); entry.Value = value; _settingsTable.Add(name, entry); entry.OnSettingChanged += new EventHandler(OnSettingChanged); } }