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); } } } }
public static void IInitiatedSettingsUpdate() { UpdateSettings?.Invoke(typeof(GlobalResources), EventArgs.Empty); }
private void OnSaveChanges(object sender, RoutedEventArgs e) { UpdateSettings?.Invoke(this, new SettingsEventArgs()); MessageBox.Show("Changes saved successfully.", "ETT Time Tracker"); }
private void OnDiscardChanges(object sender, RoutedEventArgs e) { UpdateSettings?.Invoke(this, new SettingsEventArgs(false)); MessageBox.Show("Changes discarded.", "ETT Time Tracker"); }