public PersistanceManager(ITinyMessengerHub hub, ILegacySettingsMigration legacySettingsMigration, IJsonSettingsFileManager jsonSettingsFileManager, IPluginLogManager pluginLogManager, IVersionProvider versionProvider) { _hub = hub; _jsonSettingsFileManager = jsonSettingsFileManager; _versionProvider = versionProvider; UserSettingsModel = _jsonSettingsFileManager.Load(); legacySettingsMigration.MigrateLegacySettings(UserSettingsModel); pluginLogManager.Initialize(UserSettingsModel.DebugLogEnabled ? LogLevel.Debug : LogLevel.Error); }
public PersistenceManager( ITinyMessengerHub hub, IJsonSettingsFileManager jsonSettingsFileManager, IPluginLogManager pluginLogManager, IVersionProvider versionProvider) { _hub = hub; _jsonSettingsFileManager = jsonSettingsFileManager ?? throw new ArgumentNullException(nameof(jsonSettingsFileManager)); _versionProvider = versionProvider; UserSettingsModel = _jsonSettingsFileManager.Load(); if (pluginLogManager == null) { throw new ArgumentNullException(nameof(pluginLogManager)); } pluginLogManager.Initialize(UserSettingsModel.DebugLogEnabled ? LogLevel.Debug : LogLevel.Error); }
public LegacySettingsMigration(IStorageLocationProvider storageLocationProvider, IJsonSettingsFileManager jsonSettingsFileManager) { _jsonSettingsFileManager = jsonSettingsFileManager; _settingsFile = storageLocationProvider.LegacySettingsFile; }