public void CalculateEquivalentPairs(CommandEvent commandEvent)
        {
            if (ConcurrentEventHeuristic.IsIgnorableTextControlCommand(commandEvent.CommandId))
            {
                return;
            }

            if (_lastCommandEvent != null &&
                ConcurrentEventHeuristic.AreConcurrent(_lastCommandEvent, commandEvent) &&
                _lastCommandEvent.CommandId != commandEvent.CommandId)
            {
                if (_lastCommandEvent.TriggeredBy != EventTrigger.Unknown ||
                    commandEvent.TriggeredBy != EventTrigger.Unknown)
                {
                    AddEquivalentCommandsToStatistic(
                        _lastCommandEvent.CommandId,
                        commandEvent.CommandId);
                }
                else
                {
                    AddEquivalentCommandsToUnknownTriggerMappings(
                        _lastCommandEvent.CommandId,
                        commandEvent.CommandId);
                }
            }

            _lastCommandEvent = commandEvent;
        }
        private void ProcessIDEEvent(IDEEvent @event)
        {
            var lastEvent = _eventCache.LastOrDefault();

            if (lastEvent != null && !ConcurrentEventHeuristic.AreConcurrent(lastEvent, @event))
            {
                if (_eventCache.Count > 1)
                {
                    ReplaceCurrentEventWith(GenerateConcurrentEvent());
                }
                _eventCache.Clear();
            }
            _eventCache.Add(@event);
        }
示例#3
0
 private static bool IsDuplicate(CommandEvent commandEvent, CommandEvent previousCommandEvent)
 {
     return(previousCommandEvent != null && previousCommandEvent.CommandId == commandEvent.CommandId &&
            ConcurrentEventHeuristic.AreConcurrent(previousCommandEvent, commandEvent));
 }