public virtual bool DoDeactivate(bool showMessage) { if (showMessage) { if (SelectedTask != null && SelectedTask.IsDirty) { MessageBoxResult showSchedulerCloseConfirmation = _popupController.ShowSchedulerCloseConfirmation(); switch (showSchedulerCloseConfirmation) { case MessageBoxResult.Cancel: case MessageBoxResult.None: return(false); case MessageBoxResult.No: return(true); } return(SchedulerTaskManager.SaveTasks()); } } if (SelectedTask != null && !showMessage) { return(SchedulerTaskManager.SaveTasks()); } return(true); }
public virtual bool DoDeactivate() { if (SelectedTask != null && SelectedTask.IsDirty) { MessageBoxResult showSchedulerCloseConfirmation = _popupController.ShowSchedulerCloseConfirmation(); if (showSchedulerCloseConfirmation == MessageBoxResult.Cancel || showSchedulerCloseConfirmation == MessageBoxResult.None) { return(false); } if (showSchedulerCloseConfirmation == MessageBoxResult.No) { return(true); } return(SaveTasks()); } return(true); }