@@ -287,7 +287,7 @@ public void LogError(string className, string message, [CallerMemberName] string
287287 public void LogException ( string className , string message , Exception e , [ CallerMemberName ] string methodName = "" ) =>
288288 Log . Exception ( className , message , e , methodName ) ;
289289
290- private readonly ConcurrentDictionary < Type , object > _pluginJsonStorages = new ( ) ;
290+ private readonly ConcurrentDictionary < Type , ISavable > _pluginJsonStorages = new ( ) ;
291291
292292 public void RemovePluginSettings ( string assemblyName )
293293 {
@@ -305,10 +305,9 @@ public void RemovePluginSettings(string assemblyName)
305305
306306 public void SavePluginSettings ( )
307307 {
308- foreach ( var value in _pluginJsonStorages . Values )
308+ foreach ( var savable in _pluginJsonStorages . Values )
309309 {
310- var savable = value as ISavable ;
311- savable ? . Save ( ) ;
310+ savable . Save ( ) ;
312311 }
313312 }
314313
@@ -507,7 +506,7 @@ public Task ShowProgressBoxAsync(string caption, Func<Action<double>, Task> repo
507506 public bool SetCurrentTheme ( ThemeData theme ) =>
508507 Theme . ChangeTheme ( theme . FileNameWithoutExtension ) ;
509508
510- private readonly ConcurrentDictionary < ( string , string , Type ) , object > _pluginBinaryStorages = new ( ) ;
509+ private readonly ConcurrentDictionary < ( string , string , Type ) , ISavable > _pluginBinaryStorages = new ( ) ;
511510
512511 public void RemovePluginCaches ( string cacheDirectory )
513512 {
@@ -524,10 +523,9 @@ public void RemovePluginCaches(string cacheDirectory)
524523
525524 public void SavePluginCaches ( )
526525 {
527- foreach ( var value in _pluginBinaryStorages . Values )
526+ foreach ( var savable in _pluginBinaryStorages . Values )
528527 {
529- var savable = value as ISavable ;
530- savable ? . Save ( ) ;
528+ savable . Save ( ) ;
531529 }
532530 }
533531
0 commit comments