Example #1
0
        public void PopRedo()
        {
            if (RedoStack.Count > 0) // ensures that there is something to be popped
            {
                CmdCollection from = RedoStack.Pop();

                /* Executes all commands in the popped list
                 * Pushes the inverse of the popped actions onto the redo stack */
                UndoStack.Push(new CmdCollection(from.ExecuteAll()));
            }
        }
Example #2
0
        public void PopUndo()
        {
            if (UndoStack.Count > 0)                  // ensures that there is something to be popped
            {
                CmdCollection from = UndoStack.Pop(); // pops the top list off of the undo stack -> all of the contents will be undone

                /* Executes all commands in the popped list
                 * Pushes the inverse of the popped actions onto the redo stack */
                RedoStack.Push(new CmdCollection(from.ExecuteAll()));
            }
        }