Ejemplo n.º 1
0
 public void Add(T item)
 {
     UndoStack.Push(item);
     CurrentItem = item;
     RedoStack.Clear();
     UndoHappened?.Invoke(this, new UndoRedoEventArgs <T>(CurrentItem));
 }
Ejemplo n.º 2
0
        public void Undo()
        {
            if (!CanUndo())
            {
                return;
            }

            CurrentItem = _undoStack.Pop();
            UndoHappened?.Invoke(this, new UndoRedoEventArgs(CurrentItem));
        }
Ejemplo n.º 3
0
 public void Undo()
 {
     if (!CanUndo)
     {
         return;
     }
     RedoStack.Push(CurrentItem);
     CurrentItem = UndoStack.Pop();
     CheckForFunc(CurrentItem);
     UndoHappened?.Invoke(this, new UndoRedoEventArgs <T>(CurrentItem));
 }