Ejemplo n.º 1
0
        public void AddAndDo(IUndoRedoCommand command)
        {
            undoBuffer.Push(command);
            redoBuffer.Clear();
            Changed?.Invoke(this, null);

            command.Do();
        }
Ejemplo n.º 2
0
 public void Redo(int redoCount = 1)
 {
     for (int i = 1; i <= redoCount; i++)
     {
         if (redoBuffer.Count != 0)
         {
             IUndoRedoCommand command = redoBuffer.Pop();
             command.Do();
             undoBuffer.Push(command);
         }
     }
     Changed?.Invoke(this, null);
 }