コード例 #1
0
        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);
                    }
                }
            }
        }
コード例 #2
0
ファイル: GlobalResources.cs プロジェクト: DilipCNair/RBS
 public static void IInitiatedSettingsUpdate()
 {
     UpdateSettings?.Invoke(typeof(GlobalResources), EventArgs.Empty);
 }
コード例 #3
0
 private void OnSaveChanges(object sender, RoutedEventArgs e)
 {
     UpdateSettings?.Invoke(this, new SettingsEventArgs());
     MessageBox.Show("Changes saved successfully.", "ETT Time Tracker");
 }
コード例 #4
0
 private void OnDiscardChanges(object sender, RoutedEventArgs e)
 {
     UpdateSettings?.Invoke(this, new SettingsEventArgs(false));
     MessageBox.Show("Changes discarded.", "ETT Time Tracker");
 }