예제 #1
0
        public ICmd Exec()
        {
            var inverse = new MultiCmd();

            for (int i = commands.Count - 1; i >= 0; i--)
            {
                inverse.commands.Add(commands[i].Exec());
            }
            return(inverse);
        }
예제 #2
0
        public void Redo()
        {
            // check if the redo stack is empty
            if (!this.RedoEmpty)
            {
                // pop the commands off of the redo stack
                MultiCmd commands = this.m_redos.Pop();

                // push the commands onto the undo stack
                this.m_undos.Push(commands.Exec());
            }
        }
예제 #3
0
 // adds commands onto the undo stack
 public void AddUndo(MultiCmd undos)
 {
     // push the undos onto the undo stack
     this.m_undos.Push(undos);
 }