private void ProcessQuery(string query)
        {
            var fquery = FormatQuery(query);

            string[] possibleKeys = Enum.GetNames(typeof(SettingName));

            foreach (var possibleKey in possibleKeys)
            {
                if (fquery.Keys.Contains(possibleKey))
                {
                    int value;

                    if (int.TryParse(fquery[possibleKey], out value))
                    {
                        var s = new Settings()
                        {
                            SettingName = (SettingName)Enum.Parse(typeof(SettingName), possibleKey), Value = value
                        };

                        UpdateSettings?.Invoke(this, s);
                    }
                }
            }
        }
Esempio n. 2
0
 public static void IInitiatedSettingsUpdate()
 {
     UpdateSettings?.Invoke(typeof(GlobalResources), EventArgs.Empty);
 }
Esempio n. 3
0
 private void OnSaveChanges(object sender, RoutedEventArgs e)
 {
     UpdateSettings?.Invoke(this, new SettingsEventArgs());
     MessageBox.Show("Changes saved successfully.", "ETT Time Tracker");
 }
Esempio n. 4
0
 private void OnDiscardChanges(object sender, RoutedEventArgs e)
 {
     UpdateSettings?.Invoke(this, new SettingsEventArgs(false));
     MessageBox.Show("Changes discarded.", "ETT Time Tracker");
 }