/// <summary> /// Перейти на предыдущую ноду. /// </summary> public void Undo() { if (!PrevExists) { throw new PrevHistoryNodeNotExistsException(); } _node = _node.PrevNode; }
/// <summary> /// Перейти на следующую ноду. /// </summary> public void Redo() { if (!NextExists) { throw new NextHistoryNodeNotExistsException(); } _node = _node.NextNode; }
/// <param name="historyEvents">События истории.</param> public void Add(IEnumerable <HistoryEvent> historyEvents) { if (_node == null) { _node = new HistoryNode(historyEvents); } else { var tmp = new HistoryNode(historyEvents) { PrevNode = _node }; _node.NextNode = tmp; _node = tmp; } }
public History() { _node = null; }
/// <param name="historyEvent">Событие истории.</param> public History(HistoryEvent historyEvent) { _node = new HistoryNode(historyEvent); }
/// <param name="historyEvents">События истории.</param> public History(IEnumerable <HistoryEvent> historyEvents) { _node = new HistoryNode(historyEvents); }