Beispiel #1
0
        public CoreActionHistoryEvent AddCoreAction(CoreAction coreAction, int id)
        {
            // Instead of continually adding "RunUntil" actions, just keep updating the
            // current one if it's a RunUntil, and only notify once we've finished. That
            // happens either when we add a non-RunUntil node after a RunUntil node, or
            // when we change the current node and the current node is a RunUntil. See
            // SetCurrentNode for that case.
            bool notify = coreAction.Type != CoreRequest.Types.RunUntil;

            if (!notify)
            {
                if (_currentNode is CoreActionHistoryNode currentCoreActionNode &&
                    currentCoreActionNode.Children.Count == 0 &&
                    currentCoreActionNode.CoreAction.Type == CoreRequest.Types.RunUntil)
                {
                    currentCoreActionNode.CoreAction.StopTicks = coreAction.StopTicks;

                    return(currentCoreActionNode.HistoryEvent as CoreActionHistoryEvent);
                }
            }

            CoreActionHistoryNode historyNode = new CoreActionHistoryNode(id, coreAction.Ticks, coreAction, _currentNode, DateTime.Now);

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

            AddChildNode(historyNode, notify);

            return(historyNode.HistoryEvent as CoreActionHistoryEvent);
        }
Beispiel #2
0
 internal CoreActionHistoryEvent(CoreActionHistoryNode historyNode) : base()
 {
     _node = historyNode;
 }