public void BringIntoView(LogLineIndex logLineIndex, LogLineMatch match = new LogLineMatch()) { var height = PartTextCanvas.ActualHeight; var offset = PartTextCanvas.YOffset; var start = PartTextCanvas.CurrentLine; var diff = logLineIndex - start; var minY = diff * TextHelper.LineHeight + offset; var maxY = (diff + 1) * TextHelper.LineHeight + offset; if (minY < 0) { _verticalScrollBar.Value += minY; } else if (maxY > height) { _verticalScrollBar.Value += maxY - height; } var minX = TextHelper.GlyphWidth * match.Index; var maxX = TextHelper.GlyphWidth * (match.Index + match.Count); var visibleMinX = _horizontalScrollBar.Value; var visibleMaxX = visibleMinX + _horizontalScrollBar.ViewportSize; if (maxX < visibleMinX || minX > visibleMaxX) { _horizontalScrollBar.Value = minX; } var logFile = LogFile; if (logFile != null) { var count = logFile.Count; if (count > 0) { FollowTail = logLineIndex >= count - 1; } } }
private void TextCanvasOnRequestBringIntoView(LogLineIndex logLineIndex, LogLineMatch match) { BringIntoView(logLineIndex, match); }
public void Add(LogLineIndex index, LogLineMatch match) { Add(new LogMatch(index, match)); }
public LogMatch(int index, LogLineMatch match) { Index = index; Match = match; }