public override void Execute() { base.Execute(); UndoActivity = CreateUndoActivity(); UndoActivity.AffectedFigures = new FigureCollection(DrawingView.SelectionEnumerator); foreach (IFigure figure in DrawingView.Drawing.FiguresEnumerator) { DrawingView.AddToSelection(figure); } }
public override bool Undo() { if (base.Undo() == false) { return(false); } DrawingView.ClearSelection(); DrawingView.AddToSelection(AffectedFigures.ToFigures()); return(true); }
public override bool Redo() { // do not call execute directly as the selection might has changed if (Redoable) { foreach (IFigure figure in DrawingView.Drawing.FiguresEnumerator) { DrawingView.AddToSelection(figure); } return(true); } return(false); }