public void Add(T item) { UndoStack.Push(item); CurrentItem = item; RedoStack.Clear(); UndoHappened?.Invoke(this, new UndoRedoEventArgs <T>(CurrentItem)); }
public void Undo() { if (!CanUndo()) { return; } CurrentItem = _undoStack.Pop(); UndoHappened?.Invoke(this, new UndoRedoEventArgs(CurrentItem)); }
public void Undo() { if (!CanUndo) { return; } RedoStack.Push(CurrentItem); CurrentItem = UndoStack.Pop(); CheckForFunc(CurrentItem); UndoHappened?.Invoke(this, new UndoRedoEventArgs <T>(CurrentItem)); }