2
2
using System . Collections . Generic ;
3
3
using System . Collections . ObjectModel ;
4
4
using System . Collections . Specialized ;
5
- using System . ComponentModel ;
6
- using System . Configuration ;
7
5
using System . Linq ;
8
6
using System . Threading ;
9
7
using System . Threading . Tasks ;
10
8
using System . Windows ;
11
9
using System . Windows . Controls ;
12
10
using System . Windows . Data ;
13
11
using System . Windows . Documents ;
14
- using System . Windows . Forms ;
15
12
using Flow . Launcher . Infrastructure . UserSettings ;
16
13
using Flow . Launcher . Plugin ;
17
14
@@ -137,13 +134,11 @@ public void KeepResultsExcept(PluginMetadata metadata)
137
134
Results . Update ( Results . Where ( r => r . Result . PluginID != metadata . ID ) . ToList ( ) ) ;
138
135
}
139
136
140
-
141
137
/// <summary>
142
138
/// To avoid deadlock, this method should not called from main thread
143
139
/// </summary>
144
140
public void AddResults ( List < Result > newRawResults , string resultId )
145
141
{
146
-
147
142
lock ( _collectionLock )
148
143
{
149
144
var newResults = NewResults ( newRawResults , resultId ) ;
@@ -193,8 +188,6 @@ public void AddResults(IEnumerable<ResultsForUpdate> resultsForUpdates, Cancella
193
188
Results . Update ( newResults , token ) ;
194
189
if ( Results . Any ( ) )
195
190
SelectedItem = Results [ 0 ] ;
196
-
197
-
198
191
}
199
192
200
193
switch ( Visbility )
@@ -212,7 +205,6 @@ public void AddResults(IEnumerable<ResultsForUpdate> resultsForUpdates, Cancella
212
205
213
206
}
214
207
215
-
216
208
private List < ResultViewModel > NewResults ( List < Result > newRawResults , string resultId )
217
209
{
218
210
if ( newRawResults . Count == 0 )
@@ -222,8 +214,6 @@ private List<ResultViewModel> NewResults(List<Result> newRawResults, string resu
222
214
223
215
var newResults = newRawResults . Select ( r => new ResultViewModel ( r , _settings ) ) . ToList ( ) ;
224
216
225
-
226
-
227
217
return results . Where ( r => r . Result . PluginID != resultId )
228
218
. Concat ( results . Intersect ( newResults ) . Union ( newResults ) )
229
219
. OrderByDescending ( r => r . Result . Score )
@@ -245,7 +235,6 @@ private List<ResultViewModel> NewResults(IEnumerable<ResultsForUpdate> resultsFo
245
235
}
246
236
#endregion
247
237
248
-
249
238
#region FormattedText Dependency Property
250
239
public static readonly DependencyProperty FormattedTextProperty = DependencyProperty . RegisterAttached (
251
240
"FormattedText" ,
@@ -279,7 +268,6 @@ private static void FormattedTextPropertyChanged(DependencyObject d, DependencyP
279
268
280
269
public class ResultCollection : ObservableCollection < ResultViewModel >
281
270
{
282
-
283
271
private long editTime = 0 ;
284
272
285
273
private bool _suppressNotifying = false ;
@@ -323,9 +311,6 @@ public void RemoveAll()
323
311
ClearItems ( ) ;
324
312
}
325
313
326
-
327
-
328
-
329
314
/// <summary>
330
315
/// Update the results collection with new results, try to keep identical results
331
316
/// </summary>
0 commit comments