public void Redo() { if (_redoStack.Count > 0) { TestChangeEvent changeEvent = _redoStack.Pop(); fireRedoEvent(changeEvent); _undoStack.Push(changeEvent); } }
public void Undo() { TestChangeEvent changeEvent = null; if (_undoStack.Count > 0) { changeEvent = _undoStack.Pop(); Debug.WriteLine("Undo event popped: " + changeEvent.ToString()); fireUndoEvent(changeEvent); _redoStack.Push(changeEvent); } }
public void RecordChangeEvent(TestChangeEvent changeEvent) { Debug.WriteLine("Event recorded: " + changeEvent.ToString()); _undoStack.Push(changeEvent); }
/// <summary> /// Creates a createTestHistoryRedoEvent for undo entity. /// </summary> /// <param name="testObject">Entity from undo stack.</param> private void fireRedoEvent(TestChangeEvent entity) { // If client event handler defined... OnTestHistoryRedoEvent?.Invoke(entity); }