@@ -159,7 +159,7 @@ public MainViewModel()
159
159
} ;
160
160
_selectedResults = Results ;
161
161
162
- Results . PropertyChanged += ( _ , args ) =>
162
+ Results . PropertyChanged += ( o , args ) =>
163
163
{
164
164
switch ( args . PropertyName )
165
165
{
@@ -171,7 +171,7 @@ public MainViewModel()
171
171
}
172
172
} ;
173
173
174
- History . PropertyChanged += ( _ , args ) =>
174
+ History . PropertyChanged += ( o , args ) =>
175
175
{
176
176
switch ( args . PropertyName )
177
177
{
@@ -298,15 +298,15 @@ public void ReQuery()
298
298
{
299
299
if ( QueryResultsSelected ( ) )
300
300
{
301
- // When we are requerying , we should not delay the query
301
+ // When we are requiring , we should not delay the query
302
302
_ = QueryResultsAsync ( false , isReQuery : true ) ;
303
303
}
304
304
}
305
305
306
306
public void ReQuery ( bool reselect )
307
307
{
308
308
BackToQueryResults ( ) ;
309
- // When we are requerying , we should not delay the query
309
+ // When we are requiring , we should not delay the query
310
310
_ = QueryResultsAsync ( false , isReQuery : true , reSelect : reselect ) ;
311
311
}
312
312
@@ -315,7 +315,7 @@ public void ReverseHistory()
315
315
{
316
316
if ( _history . Items . Count > 0 )
317
317
{
318
- ChangeQueryText ( _history . Items [ ^ lastHistoryIndex ] . Query . ToString ( ) ) ;
318
+ ChangeQueryText ( _history . Items [ ^ lastHistoryIndex ] . Query ) ;
319
319
if ( lastHistoryIndex < _history . Items . Count )
320
320
{
321
321
lastHistoryIndex ++ ;
@@ -328,7 +328,7 @@ public void ForwardHistory()
328
328
{
329
329
if ( _history . Items . Count > 0 )
330
330
{
331
- ChangeQueryText ( _history . Items [ ^ lastHistoryIndex ] . Query . ToString ( ) ) ;
331
+ ChangeQueryText ( _history . Items [ ^ lastHistoryIndex ] . Query ) ;
332
332
if ( lastHistoryIndex > 1 )
333
333
{
334
334
lastHistoryIndex -- ;
@@ -660,7 +660,7 @@ private async Task ChangeQueryTextAsync(string queryText, bool isReQuery = false
660
660
}
661
661
else if ( isReQuery )
662
662
{
663
- // When we are requerying , we should not delay the query
663
+ // When we are requiring , we should not delay the query
664
664
await QueryAsync ( false , isReQuery : true ) ;
665
665
}
666
666
@@ -753,7 +753,7 @@ private ResultsViewModel SelectedResults
753
753
public Visibility ProgressBarVisibility { get ; set ; }
754
754
public Visibility MainWindowVisibility { get ; set ; }
755
755
756
- // This is to be used for determining the visibility status of the mainwindow instead of MainWindowVisibility
756
+ // This is to be used for determining the visibility status of the main window instead of MainWindowVisibility
757
757
// because it is more accurate and reliable representation than using Visibility as a condition check
758
758
public bool MainWindowVisibilityStatus { get ; set ; } = true ;
759
759
@@ -1071,9 +1071,7 @@ private void QueryContextMenu()
1071
1071
1072
1072
if ( selected != null ) // SelectedItem returns null if selection is empty.
1073
1073
{
1074
- List < Result > results ;
1075
-
1076
- results = PluginManager . GetContextMenusForPlugin ( selected ) ;
1074
+ var results = PluginManager . GetContextMenusForPlugin ( selected ) ;
1077
1075
results . Add ( ContextMenuTopMost ( selected ) ) ;
1078
1076
results . Add ( ContextMenuPluginInfo ( selected . PluginID ) ) ;
1079
1077
@@ -1227,16 +1225,16 @@ private async Task QueryResultsAsync(bool searchDelay, bool isReQuery = false, b
1227
1225
TaskContinuationOptions . NotOnCanceled ,
1228
1226
TaskScheduler . Default ) ;
1229
1227
1230
- // plugins is ICollection, meaning LINQ will get the Count and preallocate Array
1228
+ // plugins are ICollection, meaning LINQ will get the Count and preallocate Array
1231
1229
1232
1230
var tasks = plugins . Select ( plugin => plugin . Metadata . Disabled switch
1233
1231
{
1234
- false => QueryTaskAsync ( plugin , searchDelay , reSelect , _updateSource . Token ) ,
1232
+ false => QueryTaskAsync ( plugin , _updateSource . Token ) ,
1235
1233
true => Task . CompletedTask
1236
1234
} ) . ToArray ( ) ;
1237
1235
1238
1236
// TODO: Remove debug codes.
1239
- System . Diagnostics . Debug . Write ( $ "!!!Querying { query . RawQuery } : search dalay { searchDelay } ") ;
1237
+ System . Diagnostics . Debug . Write ( $ "!!!Querying { query . RawQuery } : search delay { searchDelay } ") ;
1240
1238
foreach ( var plugin in plugins )
1241
1239
{
1242
1240
if ( ! plugin . Metadata . Disabled )
@@ -1269,7 +1267,7 @@ private async Task QueryResultsAsync(bool searchDelay, bool isReQuery = false, b
1269
1267
}
1270
1268
1271
1269
// Local function
1272
- async Task QueryTaskAsync ( PluginPair plugin , bool searchDelay , bool reSelect , CancellationToken token )
1270
+ async Task QueryTaskAsync ( PluginPair plugin , CancellationToken token )
1273
1271
{
1274
1272
if ( searchDelay )
1275
1273
{
@@ -1623,7 +1621,7 @@ public void Save()
1623
1621
}
1624
1622
1625
1623
/// <summary>
1626
- /// To avoid deadlock, this method should not called from main thread
1624
+ /// To avoid deadlock, this method should not be called from main thread
1627
1625
/// </summary>
1628
1626
public void UpdateResultView ( ICollection < ResultsForUpdate > resultsForUpdates )
1629
1627
{
0 commit comments