Exemple #1
0
        public override void Execute()
        {
            base.Execute();

            UndoActivity = CreateUndoActivity();
            UndoActivity.AffectedFigures = new FigureCollection(DrawingView.SelectionEnumerator);
            foreach (IFigure figure in DrawingView.Drawing.FiguresEnumerator)
            {
                DrawingView.AddToSelection(figure);
            }
        }
Exemple #2
0
            public override bool Undo()
            {
                if (base.Undo() == false)
                {
                    return(false);
                }

                DrawingView.ClearSelection();
                DrawingView.AddToSelection(AffectedFigures.ToFigures());

                return(true);
            }
Exemple #3
0
            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);
            }