@@ -148,6 +148,14 @@ private List<Result> ParseResults(JsonRPCQueryResponseModel queryResponseModel)
148
148
149
149
results . AddRange ( queryResponseModel . Result ) ;
150
150
151
+ if ( queryResponseModel . SettingsChange != null )
152
+ {
153
+ foreach ( var ( key , value ) in queryResponseModel . SettingsChange )
154
+ {
155
+ Settings [ key ] = value ;
156
+ }
157
+ }
158
+
151
159
return results ;
152
160
}
153
161
@@ -300,10 +308,11 @@ public async Task<List<Result>> QueryAsync(Query query, CancellationToken token)
300
308
var request = new JsonRPCRequestModel
301
309
{
302
310
Method = "query" ,
303
- Parameters = new [ ]
311
+ Parameters = new object [ ]
304
312
{
305
313
query . Search
306
- }
314
+ } ,
315
+ Settings = Settings
307
316
} ;
308
317
var output = await RequestAsync ( request , token ) ;
309
318
return await DeserializedResultAsync ( output ) ;
@@ -345,7 +354,8 @@ public Control CreateSettingPanel()
345
354
var settingWindow = new UserControl ( ) ;
346
355
var mainPanel = new StackPanel
347
356
{
348
- Margin = settingControlMargin , Orientation = Orientation . Vertical
357
+ Margin = settingControlMargin ,
358
+ Orientation = Orientation . Vertical
349
359
} ;
350
360
settingWindow . Content = mainPanel ;
351
361
@@ -370,7 +380,8 @@ public Control CreateSettingPanel()
370
380
{
371
381
var textBox = new TextBox ( )
372
382
{
373
- Width = 300 , Text = Settings [ attribute . Name ] as string ?? string . Empty ,
383
+ Width = 300 ,
384
+ Text = Settings [ attribute . Name ] as string ?? string . Empty ,
374
385
Margin = settingControlMargin
375
386
} ;
376
387
textBox . TextChanged += ( _ , _ ) =>
@@ -401,7 +412,8 @@ public Control CreateSettingPanel()
401
412
{
402
413
var comboBox = new ComboBox ( )
403
414
{
404
- ItemsSource = attribute . Options , SelectedItem = Settings [ attribute . Name ] ,
415
+ ItemsSource = attribute . Options ,
416
+ SelectedItem = Settings [ attribute . Name ] ,
405
417
Margin = settingControlMargin
406
418
} ;
407
419
comboBox . SelectionChanged += ( sender , _ ) =>
@@ -419,7 +431,7 @@ public Control CreateSettingPanel()
419
431
} ;
420
432
checkBox . Click += ( sender , _ ) =>
421
433
{
422
- Settings [ attribute . Name ] = ( ( CheckBox ) sender ) . IsChecked ;
434
+ Settings [ attribute . Name ] = ( ( CheckBox ) sender ) . IsChecked ;
423
435
} ;
424
436
contentControl = checkBox ;
425
437
break ;
0 commit comments