Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EPO.ViewModel.MainFormViewModelBase.QuitCommandLogic()
- ==============================================
- private void QuitCommandLogic()
- {
- this._appClosing = true;
- if (DialogContainer.StudyFormViewModel != null)
- {
- DialogContainer.StudyFormViewModel.BlockHighKv();
- }
- if (!this.TryCloseArchivingDialog())
- {
- DialogService.ShowMessageBox(EpoMainResources.get_QuitIsForbiddenBecauseOfArchivingMessage(), EpoMainResources.get_InfoMessageBoxTittle(), MessageBoxButton.OK, MessageBoxResult.None, false, null, 0);
- this._appClosing = false;
- return;
- }
- if (DialogService.ShowMessageBox(EpoMainResources.get_ApplicationExitConfirmation(), EpoMainResources.get_ConfirmationMessageBoxTittle(), MessageBoxButton.YesNo, MessageBoxResult.None, false, null, 0) != MessageBoxResult.Yes)
- {
- this._appClosing = false;
- return;
- }
- IMessenger messenger = SimpleServiceLocator.Instance.Get<IMessenger>();
- if (messenger != null)
- {
- messenger.SendMessage(MessageType.ApplicationClosing);
- }
- List<BackupFilesHelper.BackupFileInfo> backupFoldersToDelete = BackupFilesHelper.GetBackupFoldersToDelete();
- List<string> list = (
- from i in SimpleServiceLocator.Instance.Get<IWgdEntityService>().GetImages((EpoModel.Wgd.Image i) => {
- if (i.get_StudyImageStatus() != 3)
- {
- return false;
- }
- return i.get_DateCreation() < DateTime.Now.AddDays((double)CommonParameters.get_Instance().get_BackupExpDays());
- }, null)
- select i.get_FileName()).ToList<string>();
- if (backupFoldersToDelete.Count > 0 || list.Count > 0)
- {
- if (DialogService.ShowMessageBox((CommonParameters.get_Instance().get_BackupExpDays() == 1 ? EpoMainResources.get_OneDayImagesRemovingConfirmFormat() : string.Format(EpoMainResources.get_OldImagesRemovingConfirmFormat(), CommonParameters.get_Instance().get_BackupExpDays())), EpoMainResources.get_ConfirmationMessageBoxTittle(), MessageBoxButton.YesNo, MessageBoxResult.None, false, null, 0) == MessageBoxResult.Yes)
- {
- BackupFilesHelper.DeleteExpiredBackupFiles(backupFoldersToDelete);
- BackupFilesHelper.DeleteExpiredImageFiles(list);
- }
- this._secondMonitorForm.Close();
- }
- base.IsNeedClose = true;
- DialogContainer.ArchivingViewModel.Dialog.Close();
- SimpleServiceLocator.Instance.Get<ApplicationLifecycleService>().Shutdown(ApplicationLifecycleService.ShutdownMode.ApplicationAndComputer);
- }
- this.DeletePacsStudies();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement