From f6bc10e821530771cae4c8fb7ab142cb7391dad3 Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Sat, 9 Sep 2023 09:47:23 -0400 Subject: [PATCH] Updated deprecated usage of TextView `Redraw(ISegment, DispatcherPriority)` to only pass, `ISegment`. Updated deprecated usage of `ForegroundBrush` property to `SetForegroundBrush()` method. --- ILSpy.Core/AvalonEdit/TextMarkerService.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ILSpy.Core/AvalonEdit/TextMarkerService.cs b/ILSpy.Core/AvalonEdit/TextMarkerService.cs index e31d3b6..b06d0d8 100644 --- a/ILSpy.Core/AvalonEdit/TextMarkerService.cs +++ b/ILSpy.Core/AvalonEdit/TextMarkerService.cs @@ -111,9 +111,8 @@ public void Remove(ITextMarker marker) /// internal void Redraw(ISegment segment) { - textView.Redraw(segment, DispatcherPriority.Normal); - if (RedrawRequested != null) - RedrawRequested(this, EventArgs.Empty); + textView.Redraw(segment); + RedrawRequested?.Invoke(this, EventArgs.Empty); } public event EventHandler RedrawRequested; @@ -137,7 +136,7 @@ protected override void ColorizeLine(DocumentLine line) Math.Min(marker.EndOffset, lineEnd), element => { if (foregroundBrush != null) { - element.TextRunProperties.ForegroundBrush = foregroundBrush; + element.TextRunProperties.SetForegroundBrush(foregroundBrush); } // TODO: change font style //string tf = element.TextRunProperties.Typeface;