Пример #1
0
        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);
            }
        }
Пример #2
0
 public bool GetSettingAsBool(ServerSettingsKeys key)
 {
     return(Convert.ToBoolean(GetSetting(key)));
 }
Пример #3
0
        public string GetSetting(ServerSettingsKeys key)
        {
            string setting = key.ToString();

            return(_settings.GetOrAdd(setting, defaults.ContainsKey(setting) ? defaults[setting] : ""));
        }
Пример #4
0
 public Setting GetGeneralSetting(ServerSettingsKeys key)
 {
     return(GetSetting("General Settings", key.ToString()));
 }
Пример #5
0
 public void SetExternalAWACSModeSetting(ServerSettingsKeys key, string value)
 {
     SetSetting("External AWACS Mode Settings", key.ToString(), value);
 }
Пример #6
0
 public Setting GetExternalAWACSModeSetting(ServerSettingsKeys key)
 {
     return(GetSetting("External AWACS Mode Settings", key.ToString()));
 }
Пример #7
0
 public void SetServerSetting(ServerSettingsKeys key, bool value)
 {
     SetSetting("Server Settings", key.ToString(), value.ToString(CultureInfo.InvariantCulture));
 }
Пример #8
0
 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] : "")));
        }