Пример #1
0
        private void OnClose(EventArgs args)
        {
            try
            {
                _repository.Shutdown();
            }
            catch (Exception e)
            {
                App.Logger.Error("Main", "Shutting down connection failed", e);
                ExceptionDialog.Show(Owner, "Shutting down connection failed.\r\nConnection will be forcefully aborted.", e, string.Empty);
                _repository.KillThread();
            }

            if (Settings.RememberScroll)
            {
                _scrollCache.ForceSaveNow();
            }

            if (Settings.RememberPositionAndSize || Settings.RememberWindowState)
            {
                SettingsHelper.ApplyWindowState(Owner, Settings, Settings.RememberPositionAndSize, Settings.RememberPositionAndSize, Settings.RememberWindowState);
                RequestSettingsSave();
            }

            if (_invSaveSettings.HasPendingRequests())
            {
                _invSaveSettings.CancelPendingRequests();
                SaveSettings();
            }

            Owner.MainWindow_OnClosed(args);
        }
Пример #2
0
 public void SaveIfDirty()
 {
     if (invSave.HasPendingRequests())
     {
         ForceSaveNow();
     }
 }