@@ -109,6 +109,14 @@ private List<Result> ParseResults(JsonRPCQueryResponseModel queryResponseModel)
109
109
{
110
110
result . Action = c =>
111
111
{
112
+ if ( result . SettingsChange is not null )
113
+ {
114
+ foreach ( var ( key , value ) in result . SettingsChange )
115
+ {
116
+ Settings [ key ] = value ;
117
+ }
118
+ }
119
+
112
120
if ( result . JsonRPCAction == null ) return false ;
113
121
114
122
if ( string . IsNullOrEmpty ( result . JsonRPCAction . Method ) )
@@ -442,54 +450,6 @@ public Control CreateSettingPanel()
442
450
panel . Children . Add ( contentControl ) ;
443
451
mainPanel . Children . Add ( panel ) ;
444
452
}
445
-
446
- // foreach (var (key, value) in Settings)
447
- // {
448
- // var panel = new StackPanel
449
- // {
450
- // Orientation = Orientation.Horizontal, Margin = settingControlMargin
451
- // };
452
- // var name = new Label
453
- // {
454
- // Content = key, VerticalAlignment = VerticalAlignment.Center
455
- // };
456
- // UIElement content = null;
457
- // switch (value)
458
- // {
459
- // case int i:
460
- // case double d:
461
- // throw new TypeAccessException();
462
- // case string s:
463
- // var textBox = new TextBox
464
- // {
465
- // Text = s,
466
- // Margin = settingControlMargin,
467
- // VerticalAlignment = VerticalAlignment.Center
468
- // };
469
- // textBox.TextChanged += (_, _) =>
470
- // {
471
- // Settings[key] = textBox.Text;
472
- // };
473
- // content = textBox;
474
- // break;
475
- // case bool b:
476
- // var checkBox = new CheckBox
477
- // {
478
- // IsChecked = b,
479
- // Margin = settingControlMargin,
480
- // VerticalAlignment = VerticalAlignment.Center
481
- // };
482
- // checkBox.Click += (_, _) =>
483
- // {
484
- // Settings[key] = checkBox.IsChecked;
485
- // };
486
- // content = checkBox;
487
- // break;
488
- // default:
489
- // throw new ArgumentOutOfRangeException();
490
- // }
491
- //
492
- // }
493
453
return settingWindow ;
494
454
}
495
455
public void Save ( )
0 commit comments