public void ClearScanRegion() { if (_region != null) { _document.MarkerStrategy.RemoveMarker(_region); _document.TextContentChanged -= DocumentOnTextContentChanged; _region = null; ScanRegionChanged?.Invoke(this, EventArgs.Empty); } }
/// <summary>Sets the region to search. The region is updated /// automatically as the document changes.</summary> public void SetScanRegion(int offset, int length) { Color bkgColor = _document.HighlightingStrategy.GetColorFor("Default").BackgroundColor; _region = new TextMarker(offset, length, TextMarkerType.SolidBlock, Globals.HalfMix(bkgColor, Color.FromArgb(160, 160, 160))); _document.MarkerStrategy.AddMarker(_region); _document.TextContentChanged += DocumentOnTextContentChanged; ScanRegionChanged?.Invoke(this, EventArgs.Empty); }