protected override void DoExecute(ExecutionEvent executionEvent)
        {
            try
            {
                ICollection <Guid> idsToRemove     = TreeNavigationItem.CollectIds(executionEvent.GetSelectedTreeNavigationItems());
                string             questionMessage = GetQuestionMessage(idsToRemove.Count, executionEvent.GetFirstSelectedTreeNavigationItem().Name);
                if (MessageBoxResult.No.Equals(MessageDialogUtils.Question(questionMessage, executionEvent.GetFirstSelectedTreeNavigationItem().Name)))
                {
                    return;
                }

                foreach (Guid idToRemove in idsToRemove)
                {
                    Delete(executionEvent, idToRemove);
                    OnSuccessful(executionEvent, idToRemove);
                }
            }
            catch (ValidationException ex)
            {
                WindowsManager.GetInstance().ShowDialog <MessageWindow>(new MessageWindowModelView(ex.GetValidationResult()));
            }
        }
 protected override void OnSuccessful(ExecutionEvent executionEvent, Guid affectedObjectId)
 {
 }
 protected override void OnFailure(ExecutionEvent executionEvent)
 {
     Log.Error("Error during the copying");
 }
 protected override void DoExecute(ExecutionEvent executionEvent)
 {
     Clipboard.SetData("copy", executionEvent.GetSelectedTreeNavigationItems());
 }
Beispiel #5
0
 protected abstract void OnFailure(ExecutionEvent executionEvent);
Beispiel #6
0
 protected abstract void OnSuccessful(ExecutionEvent executionEvent, Guid affectedObjectId);
Beispiel #7
0
 protected abstract void DoExecute(ExecutionEvent executionEvent);
 protected override void OnFailure(ExecutionEvent executionEvent)
 {
     throw new NotImplementedException();
 }
 protected override void OnSuccessful(ExecutionEvent executionEvent, Guid affectedObjectId)
 {
     throw new NotImplementedException();
 }
 protected override void OnSuccessful(ExecutionEvent executionEvent, Guid affectedObjectId)
 {
     Log.Info(string.Format("Entity '{0}' was deleted", affectedObjectId));
     Publisher.GetInstance().Publish(PublishEvent.CreateDeletionEvent(affectedObjectId, null));
 }
Beispiel #11
0
        public static void Execute <T>(ExecutionEvent executionEvent) where T : BaseHandler
        {
            T handler = Activator.CreateInstance <T>();

            handler.Execute(executionEvent);
        }
Beispiel #12
0
 protected override void OnSuccessful(ExecutionEvent executionEvent, Guid affectedObjectId)
 {
     Log.Info(string.Format("Entity '{0}' was craeted", affectedObjectId));
     Publisher.GetInstance().Publish(PublishEvent.CreateCreationEvent(affectedObjectId, executionEvent.GetFirstSelectedTreeNavigationItem().Id));
 }
Beispiel #13
0
 protected override void OnFailure(ExecutionEvent executionEvent)
 {
     Log.Error("Error during the insertion of the entity");
 }
Beispiel #14
0
 protected virtual T CreateNewDto(ExecutionEvent executionEvent)
 {
     return(Activator.CreateInstance <T>());
 }
Beispiel #15
0
 protected virtual WizardModelView <T> CreateWizardModelView(ExecutionEvent executionEvent)
 {
     return(new WizardModelView <T>(CreateNewDto(executionEvent)));
 }