Ejemplo n.º 1
0
        private IStackedCommand GetUndoneCommand()
        {
            IStackedCommand topStackedCommandModel = modelUndoStack.Empty ? null : modelUndoStack.Peek();
            IStackedCommand undoneCommand;

            if (topStackedCommandModel != null)
            {
                undoneCommand = topStackedCommandModel;
            }
            else
            {
                throw new InvalidOperationException(CommandError.CMDERR_STACK_INCONSISTENT);
            }
            return(undoneCommand);
        }
Ejemplo n.º 2
0
        public void Execute(object parameter)
        {
            IStackedCommand undoneCommand = GetUndoneCommand();

            undoneCommand.UnExecute();
            if (undoneCommand is DiagramCommandBase)
            {
                ActivateDiagramCommand c = ActivateDiagramCommandFactory.Factory().Create(Controller) as ActivateDiagramCommand;
                c.Set((undoneCommand as DiagramCommandBase).Controller.Diagram);
                Debug.WriteLine("Changing active diagram due to Undo");
                c.Execute();
            }
            if (undoneCommand is MacroCommand <DiagramController> )
            {
                ActivateDiagramCommand c = ActivateDiagramCommandFactory.Factory().Create(Controller) as ActivateDiagramCommand;
                c.Set((undoneCommand as MacroCommand <DiagramController>).Controller.Diagram);
                Debug.WriteLine("Changing active diagram due to Undo");
                c.Execute();
            }
            if (UndoExecuted != null)
            {
                UndoExecuted(undoneCommand);
            }
        }
Ejemplo n.º 3
0
 private void updateSelectionAfterCommand(IStackedCommand command)
 {
     updateSelectionAfterCommand((CommandBase)command);
 }
Ejemplo n.º 4
0
 void updateLayout(IStackedCommand command)
 {
     updateLayout();
 }