Пример #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);
        }
Пример #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);
        }