示例#1
0
 private void settingsMenuItem_Click(object sender, EventArgs e)
 {
     var editor = new SettingsDialog(Hook, Settings);
     editor.SumOfBestModeChanged += editor_SumOfBestModeChanged;
     try
     {
         TopMost = false;
         var oldSettings = (ISettings)Settings.Clone();
         Settings.UnregisterAllHotkeys(Hook);
         var result = editor.ShowDialog(this);
         if (result == DialogResult.Cancel)
         {
             var regenerate = Settings.SimpleSumOfBest != oldSettings.SimpleSumOfBest;
             CurrentState.Settings = Settings = oldSettings;
             if (regenerate)
                 RegenerateComparisons();
         }
         else
             SwitchComparisonGenerators();
         Settings.RegisterHotkeys(Hook);
     }
     finally
     {
         SetProgressBar();
         TopMost = Layout.Settings.AlwaysOnTop;
     }
 }
示例#2
0
 private void settingsMenuItem_Click(object sender, EventArgs e)
 {
     var editor = new SettingsDialog(Hook, Settings);
     try
     {
         this.TopMost = false;
         var oldSettings = (ISettings)Settings.Clone();
         Settings.UnregisterAllHotkeys(Hook);
         var result = editor.ShowDialog(this);
         if (result == System.Windows.Forms.DialogResult.Cancel)
             Settings = oldSettings;
         Settings.RegisterHotkeys(Hook);
     }
     finally
     {
         SetProgressBar();
         this.TopMost = Layout.Settings.AlwaysOnTop;
     }
 }