예제 #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 string GetSetting(ServerSettingsKeys key)
        {
            string setting = key.ToString();

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