Exemplo n.º 1
0
        // 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();
        }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 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;
 }
Exemplo n.º 4
0
 public DbConnectionProvider(IAppSettings appSettings, IArgsService argsService)
 {
     LoadDbSettings(appSettings, argsService);
 }