Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public LegacySettingsMigration(IStorageLocationProvider storageLocationProvider,
                                IJsonSettingsFileManager jsonSettingsFileManager)
 {
     _jsonSettingsFileManager = jsonSettingsFileManager;
     _settingsFile            = storageLocationProvider.LegacySettingsFile;
 }