@@ -57,10 +57,7 @@ public async Task InitializeAsync()
57
57
}
58
58
}
59
59
60
- if ( Configuration == null )
61
- {
62
- return ;
63
- }
60
+ if ( Configuration == null ) return ;
64
61
65
62
foreach ( var ( type , attributes ) in Configuration . Body )
66
63
{
@@ -87,10 +84,7 @@ public async Task InitializeAsync()
87
84
88
85
public void UpdateSettings ( IReadOnlyDictionary < string , object > settings )
89
86
{
90
- if ( settings == null || settings . Count == 0 )
91
- {
92
- return ;
93
- }
87
+ if ( settings == null || settings . Count == 0 ) return ;
94
88
95
89
foreach ( var ( key , value ) in settings )
96
90
{
@@ -117,8 +111,7 @@ public void UpdateSettings(IReadOnlyDictionary<string, object> settings)
117
111
// If can parse the default value to bool, use it, otherwise use false
118
112
: value is string stringValue && bool . TryParse ( stringValue , out var boolValueFromString )
119
113
&& boolValueFromString ;
120
- checkBox . Dispatcher . Invoke ( ( ) =>
121
- checkBox . IsChecked = isChecked ) ;
114
+ checkBox . Dispatcher . Invoke ( ( ) => checkBox . IsChecked = isChecked ) ;
122
115
break ;
123
116
}
124
117
}
@@ -164,10 +157,7 @@ public Control CreateSettingPanel()
164
157
foreach ( var ( type , attributes ) in Configuration ! . Body )
165
158
{
166
159
// Skip if the setting does not have attributes or name
167
- if ( attributes ? . Name == null )
168
- {
169
- continue ;
170
- }
160
+ if ( attributes ? . Name == null ) continue ;
171
161
172
162
// Add a new row to the main grid
173
163
mainPanel . RowDefinitions . Add ( new RowDefinition ( )
@@ -214,10 +204,7 @@ public Control CreateSettingPanel()
214
204
215
205
// Add the name and description to the panel
216
206
panel . Children . Add ( name ) ;
217
- if ( desc != null )
218
- {
219
- panel . Children . Add ( desc ) ;
220
- }
207
+ if ( desc != null ) panel . Children . Add ( desc ) ;
221
208
}
222
209
223
210
switch ( type )
@@ -481,10 +468,7 @@ Settings[attributes.Name] is bool isChecked
481
468
}
482
469
483
470
// Add into SettingControls for settings storage if need
484
- if ( NeedSaveInSettings ( type ) )
485
- {
486
- SettingControls [ attributes . Name ] = contentControl ;
487
- }
471
+ if ( NeedSaveInSettings ( type ) ) SettingControls [ attributes . Name ] = contentControl ;
488
472
489
473
rowCount ++ ;
490
474
}
0 commit comments