public bool GetSettingAsBool(ServerSettingsKeys key) { var strKey = key.ToString(); if (_settingsBool.TryGetValue(strKey, out bool res)) { return(res); } else { res = Convert.ToBoolean(GetSetting(key)); _settingsBool[strKey] = res; return(res); } }
public string GetSetting(ServerSettingsKeys key) { string setting = key.ToString(); return(_settings.GetOrAdd(setting, defaults.ContainsKey(setting) ? defaults[setting] : "")); }
public Setting GetGeneralSetting(ServerSettingsKeys key) { return(GetSetting("General Settings", key.ToString())); }
public void SetExternalAWACSModeSetting(ServerSettingsKeys key, string value) { SetSetting("External AWACS Mode Settings", key.ToString(), value); }
public Setting GetExternalAWACSModeSetting(ServerSettingsKeys key) { return(GetSetting("External AWACS Mode Settings", key.ToString())); }
public void SetServerSetting(ServerSettingsKeys key, bool value) { SetSetting("Server Settings", key.ToString(), value.ToString(CultureInfo.InvariantCulture)); }
public void SetGeneralSetting(ServerSettingsKeys key, string value) { SetSetting("General Settings", key.ToString(), value.Trim()); }
public int GetSettingInt(ServerSettingsKeys key) { string setting = key.ToString(); return(int.Parse(_settings.GetOrAdd(setting, defaults.ContainsKey(setting) ? defaults[setting] : ""))); }