Exemplo n.º 1
0
        public IUndoRedo Exec()
        {
            var undoList = new UndoRedoCollection(Type);

            // add the inverse operation of every element to the undoList to be
            // returned and possibly [un/re]done later
            foreach (var ur in undoRedos)
            {
                undoList.Add(ur.Exec());
            }

            return(undoList);
        }
Exemplo n.º 2
0
        // exec the current popped undo and then pop it onto the redo stack
        public void DoUndo()
        {
            UndoRedoCollection redo = (UndoRedoCollection)undos.Pop().Exec();

            redos.Push(new UndoRedoCollection(redo.Type, redo));
        }
Exemplo n.º 3
0
 public void AddUndo(UndoRedoCollection ur)
 {
     undos.Push(ur);
 }