Beispiel #1
0
        public void ExecuteRedo()
        {
            var      pop            = mRedoStack.Pop();
            Cell     currentCell    = pop.GetCell();
            ICmd     current        = new MultiCmd();
            MultiCmd temp           = current as MultiCmd;
            ICmd     currentBGColor = new RestoreBGColor(currentCell, currentCell.BGColor);
            ICmd     currentText    = new RestoreText(currentCell, currentCell.Text);

            temp.Add(currentText);
            temp.Add(currentBGColor);
            AddUndo(current);
            ICmd command = pop.Exec();
        }
Beispiel #2
0
        public void ExecuteUndo()
        {
            var      pop            = mUndoStack.Pop(); //Get the top element of the stack
            Cell     currentCell    = pop.GetCell();
            ICmd     current        = new MultiCmd();
            MultiCmd temp           = current as MultiCmd;
            ICmd     currentBGColor = new RestoreBGColor(currentCell, currentCell.BGColor);
            ICmd     currentText    = new RestoreText(currentCell, currentCell.Text);

            temp.Add(currentText);
            temp.Add(currentBGColor);
            AddRedo(current);          //Push the current cell to the redo stack
            ICmd command = pop.Exec(); //Get the inverse action and apply to the cell
        }