private void frmBenchmarks_FormClosing(object sender, FormClosingEventArgs e)
 {
     // Save state data
     _prefs.Set(Preference.BenchmarksFormLocation, Location);
     _prefs.Set(Preference.BenchmarksFormSize, Size);
     _prefs.Set(Preference.BenchmarksGraphLayoutType, GraphLayoutType);
     _prefs.Save();
 }
        public void Update(IPreferenceSet prefs, IQueryParametersContainer queryContainer)
        {
            prefs.Set(Preference.HistoryBonusCalculation, _bonusCalculation);
            prefs.Set(Preference.ShowEntriesValue, _showEntriesValue);
            prefs.Set(Preference.HistoryFormLocation, FormLocation);
            prefs.Set(Preference.HistoryFormSize, FormSize);
            prefs.Set(Preference.HistorySortColumnName, SortColumnName);
            prefs.Set(Preference.HistorySortOrder, SortOrder);
            prefs.Set(Preference.HistoryFormColumns, FormColumns);
            prefs.Save();

            queryContainer.Update(_queryList.Where(x => x.Name != QueryParameters.SelectAll.Name));
        }
Beispiel #3
0
        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            // Save state data
            if (WindowState == FormWindowState.Normal)
            {
                _prefs.Set(Preference.MessagesFormLocation, Location);
                _prefs.Set(Preference.MessagesFormSize, Size);
                _prefs.Save();
            }

            Hide();
            e.Cancel = true;
            base.OnClosing(e);
        }
Beispiel #4
0
        public void ViewShown()
        {
            // Add the Index Changed Handler here after everything is shown
            _view.DataGridView.ColumnDisplayIndexChanged += delegate { DataGridViewColumnDisplayIndexChanged(); };
            // Then run it once to ensure the last column is set to Fill
            DataGridViewColumnDisplayIndexChanged();
            // Add the Splitter Moved Handler here after everything is shown - Issue 8
            // When the log file window (Panel2) is visible, this event will fire.
            // Update the split location directly from the split panel control. - Issue 8
            _view.SplitContainer.SplitterMoved += delegate
            {
                _prefs.Set(Preference.FormSplitterLocation, _view.SplitContainer.SplitterDistance);
                _prefs.Save();
            };

            if (_prefs.Get <bool>(Preference.RunMinimized))
            {
                _view.WindowState = FormWindowState.Minimized;
            }

            Debug.Assert(Arguments != null);
            var openFile = Arguments.FirstOrDefault(x => x.Type.Equals(ArgumentType.OpenFile));

            if (openFile != null)
            {
                if (!String.IsNullOrEmpty(openFile.Data))
                {
                    LoadConfigFile(openFile.Data);
                }
            }
            else if (_prefs.Get <bool>(Preference.UseDefaultConfigFile))
            {
                var fileName = _prefs.Get <string>(Preference.DefaultConfigFile);
                if (!String.IsNullOrEmpty(fileName))
                {
                    LoadConfigFile(fileName);
                }
            }

            SetViewShowStyle();

            if (_prefs.Get <bool>(Preference.StartupCheckForUpdate))
            {
                _updateLogic.CheckForUpdate();
            }
        }
      public void Update(IPreferenceSet prefs, IQueryParametersCollection queryCollection)
      {
         prefs.Set(Preference.HistoryBonusCalculation, _bonusCalculation);
         prefs.Set(Preference.ShowEntriesValue, _showEntriesValue);
         prefs.Set(Preference.HistoryFormLocation, FormLocation);
         prefs.Set(Preference.HistoryFormSize, FormSize);
         prefs.Set(Preference.HistorySortColumnName, SortColumnName);
         prefs.Set(Preference.HistorySortOrder, SortOrder);
         prefs.Set(Preference.HistoryFormColumns, FormColumns);
         prefs.Save();

         queryCollection.Clear();
         foreach (var query in _queryList)
         {
            // don't save Select All to disk
            if (query.Name != QueryParameters.SelectAll.Name)
            {
               queryCollection.Add(query);
            }
         }
         queryCollection.Write();
      }