Exemplo n.º 1
0
        public static Tuple <int, int> CalcFocusedMessageEqualRange(this IReadOnlyList <StateInspectorEvent> allChanges, FocusedMessageInfo focusedMessageInfo)
        {
            if (focusedMessageInfo == null || focusedMessageInfo.FocusedMessage == null)
            {
                return(null);
            }
            var messageLogSource = focusedMessageInfo.FocusedMessage.GetLogSource();

            if (messageLogSource == null)
            {
                return(null);
            }
            var focusedMessageTime     = focusedMessageInfo.FocusedMessage.Time;
            var focusedMessagePosition = focusedMessageInfo.FocusedMessage.Position;

            int lowerBound = ListUtils.BinarySearch(allChanges, 0, allChanges.Count,
                                                    change => EventsComparer.Compare(change, focusedMessageTime, messageLogSource, focusedMessagePosition) < 0);
            int upperBound = ListUtils.BinarySearch(allChanges, 0, allChanges.Count,
                                                    change => EventsComparer.Compare(change, focusedMessageTime, messageLogSource, focusedMessagePosition) <= 0);

            return(new Tuple <int, int>(lowerBound, upperBound));
        }
Exemplo n.º 2
0
 public FocusedMessageEventsRange(FocusedMessageInfo focusedMessage, Tuple <int, int> equalRange)
 {
     this.FocusedMessage = focusedMessage;
     this.EqualRange     = equalRange;
 }