Beispiel #1
0
 public void IssueSettingsChange()
 {
     if (OnSettingsChange != null)
     {
         OnSettingsChange.Invoke();
     }
 }
Beispiel #2
0
        public void WatchSetting(string name, OnSettingsChange onChange)
        {
            string nLower = name.ToLower();

            if (SettingsWatch.ContainsKey(nLower))
            {
                SettingsWatch[nLower] = onChange;
            }
            else
            {
                SettingsWatch.Add(nLower, onChange);
            }
        }
Beispiel #3
0
        public void UpdateSetting(string name, object value)
        {
            string nLower = name.ToLower();

            if (SettingsManager.ContainsKey(nLower))
            {
                SettingsManager[nLower] = value;
            }
            else
            {
                SettingsManager.Add(nLower, value);
            }
            if (SettingsWatch.ContainsKey(nLower))
            {
                OnSettingsChange change = SettingsWatch[nLower];
                if (change != null)
                {
                    change(nLower, value);
                }
            }
        }
Beispiel #4
0
 private void settingsButton_Click(object sender, EventArgs e)
 {
     //При изменении настроек выполняется проверка на null
     OnSettingsChange?.Invoke();
 }
Beispiel #5
0
 internal static void ApplySettings()
 {
     OnSettingsChange?.Invoke();
 }