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); }
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); } }
private void updateSelectionAfterCommand(IStackedCommand command) { updateSelectionAfterCommand((CommandBase)command); }
void updateLayout(IStackedCommand command) { updateLayout(); }