コード例 #1
0
        public void Redo()
        {
            if (_redoStack.Count > 0)
            {
                TestChangeEvent changeEvent = _redoStack.Pop();

                fireRedoEvent(changeEvent);

                _undoStack.Push(changeEvent);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        public void RecordChangeEvent(TestChangeEvent changeEvent)
        {
            Debug.WriteLine("Event recorded:  " + changeEvent.ToString());

            _undoStack.Push(changeEvent);
        }
コード例 #4
0
 /// <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);
 }