1- using System . Linq ;
1+ using System . Drawing ;
2+ using System . Linq ;
23using System . Threading . Tasks ;
34using System . Windows . Forms ;
45using WeifenLuo . WinFormsUI . Docking ;
@@ -18,7 +19,7 @@ public ExceptionControl(PluginTraceViewer ptv)
1819 InitializeComponent ( ) ;
1920 }
2021
21- internal void SetException ( string log , string caption )
22+ internal void SetException ( string log , string caption , string quickfilter )
2223 {
2324 textException . Clear ( ) ;
2425 TabText = caption ;
@@ -41,10 +42,10 @@ internal void SetException(string log, string caption)
4142 DockState ;
4243 }
4344 originallog = log . Replace ( "\r \n " , "\n " ) ;
44- _ = ShowMessageTextAsync ( ptv . tsmiHighlightGuids . Checked , ptv . tsmiIdentifyRecords . Checked ) ;
45+ _ = ShowMessageTextAsync ( ptv . tsmiHighlightGuids . Checked , ptv . tsmiIdentifyRecords . Checked , quickfilter ) ;
4546 }
4647
47- internal async Task ShowMessageTextAsync ( bool highlightguids , bool showlinks )
48+ internal async Task ShowMessageTextAsync ( bool highlightguids , bool showlinks , string quickfilter )
4849 {
4950 btnShowAllRecordLinks . Visible = showlinks ;
5051 btnShowAllRecordLinks . Enabled = false ;
@@ -71,6 +72,17 @@ internal async Task ShowMessageTextAsync(bool highlightguids, bool showlinks)
7172 }
7273 links . HighlightRecords ( textException ) ;
7374 }
75+ if ( ! string . IsNullOrWhiteSpace ( quickfilter ) )
76+ {
77+ var length = quickfilter . Length ;
78+ var pos = textException . Find ( quickfilter , 0 , RichTextBoxFinds . None ) ;
79+ while ( pos != - 1 )
80+ {
81+ textException . SelectionBackColor = Color . Red ;
82+ textException . SelectionColor = Color . White ;
83+ pos = textException . Find ( quickfilter , pos + length , RichTextBoxFinds . None ) ;
84+ }
85+ }
7486 textException . Select ( 0 , 0 ) ;
7587 }
7688
0 commit comments