Exemple #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);
        }
Exemple #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());
            }
        }
Exemple #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);
 }