示例#1
0
 public void TestRange()
 {
     LogLineIndex.Range(new LogLineIndex(1), new LogLineIndex(1)).Should().Equal(new LogLineIndex(1));
     LogLineIndex.Range(new LogLineIndex(1), new LogLineIndex(2)).Should().Equal(new LogLineIndex(1), new LogLineIndex(2));
     LogLineIndex.Range(new LogLineIndex(2), new LogLineIndex(1)).Should().Equal(new LogLineIndex(1), new LogLineIndex(2));
     LogLineIndex.Range(new LogLineIndex(3), new LogLineIndex(1)).Should().Equal(new LogLineIndex(1), new LogLineIndex(2), new LogLineIndex(3));
 }
示例#2
0
        private void OnSelectDown()
        {
            var logFile = _logSource;
            var first   = _firstSelection;
            var last    = _lastSelection;

            if (logFile == null)
            {
                return;
            }
            if (first.IsInvalid)
            {
                return;
            }
            if (last.IsInvalid)
            {
                return;
            }

            var next = last + 1;

            if (next >= _logSource.GetProperty(Properties.LogEntryCount))
            {
                return;
            }

            var indices = LogLineIndex.Range(first, next);

            SetSelected(indices, SelectMode.Replace);
            _firstSelection = first;
            _lastSelection  = next;

            var fn = RequestBringIntoView;

            fn?.Invoke(next, new LogLineMatch());

            InvalidateVisual();
        }
示例#3
0
        private void OnSelectUp()
        {
            var logFile = _logFile;
            var first   = _firstSelection;
            var last    = _lastSelection;

            if (logFile == null)
            {
                return;
            }
            if (first.IsInvalid)
            {
                return;
            }
            if (last.IsInvalid)
            {
                return;
            }

            var next = last - 1;

            if (next < 0)
            {
                return;
            }

            var indices = LogLineIndex.Range(first, next);

            SetSelected(indices, SelectMode.Replace);
            _firstSelection = first;
            _lastSelection  = next;

            var fn = RequestBringIntoView;

            fn?.Invoke(next, new LogLineMatch());

            InvalidateVisual();
        }