// disable warnings because they are being initialized in the functions in the constructor
#pragma warning disable CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable.
        public ConfigService(IArgsService argsService)
#pragma warning restore CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable.
        {
            serializer       = new XmlSerializer(typeof(Config));
            this.argsService = argsService;
            LoadConfigFileName();
            ReadConfigFile();
        }
 private void LoadDbSettings(IAppSettings appSettings, IArgsService argsService)
 {
     if (argsService.DbAccessType == DbAccessType.LiteDb)
     {
         DbFilePath       = GetDbFilePath(appSettings.LiteDbFileName);
         ConnectionString = string.Format(appSettings.LiteDbConnection, DbFilePath);
     }
     else if (argsService.DbAccessType == DbAccessType.SQLite)
     {
         DbFilePath       = GetDbFilePath(appSettings.SQLiteFileName);
         ConnectionString = string.Format(appSettings.SQLiteConnection, DbFilePath);
     }
 }
示例#3
0
 public MainService(
     IArgsService argsService,
     IConfigService configService,
     IProgramDataService programDataService,
     IMapperService mapperService,
     IModPortalClient client,
     IModsStorageService modsStorageService)
 {
     this.argsService        = argsService;
     this.configService      = configService;
     this.programDataService = programDataService;
     this.mapperService      = mapperService;
     this.client             = client;
     this.modsStorageService = modsStorageService;
 }
 public DbConnectionProvider(IAppSettings appSettings, IArgsService argsService)
 {
     LoadDbSettings(appSettings, argsService);
 }