Beispiel #1
0
        public BookmarkHistoryEvent AddBookmark(UInt64 ticks, Bookmark bookmark, DateTime creationTime, int id)
        {
            if (_currentNode is CoreActionHistoryNode currentCoreActionNode &&
                currentCoreActionNode.Children.Count == 0 &&
                currentCoreActionNode.CoreAction.Type == CoreRequest.Types.RunUntil)
            {
                // This should probably be added to AddChildNode!
                Notify(currentCoreActionNode.HistoryEvent, HistoryChangedAction.Add);
            }

            BookmarkHistoryNode historyNode = new BookmarkHistoryNode(id, ticks, bookmark, _currentNode, creationTime);

            _nextId = Math.Max(_nextId, id) + 1;

            if (ticks < _currentNode.Ticks)
            {
                throw new Exception("Can't add a bookmark with a smaller ticks than current!");
            }

            AddChildNode(historyNode, true);

            return(historyNode.HistoryEvent as BookmarkHistoryEvent);
        }
Beispiel #2
0
 internal BookmarkHistoryEvent(BookmarkHistoryNode historyNode)
 {
     _node = historyNode;
 }