/// <summary> /// Overrides should call RegisterHighlight to ensure proper registration of the Highlight. /// </summary> public override void AddHighlight(Run run, int index, int length) { HighlightAdorner adorner = new FlowDocumentScrollViewerHighlightAdorner(flowDocumentScrollViewer, run, index, length, scrollBarHighlightHandler.HorizontalScrollBarHeight, BodyHighlightAdornerBrush, BodyHighlightAdornerPen, BodyIterativeHighlightAdornerBrush, BodyIterativeHighlightAdornerPen); RegisterHighlight(new FlowDocumentScrollViewerHighlight(index, index + length, adorner, run)); }