コード例 #1
0
 public CreationKitProgramOptionsProvider(
     string ambientProgramName,
     string flagsFileName,
     CreationKitConfig defaultConfig,
     ICreationKitInisLocator inisLocator,
     ICreationKitConfigLoader configLoader,
     ILogger <CreationKitProgramOptionsProvider> logger)
 {
     _ambientProgramName = ambientProgramName;
     _flagsFileName      = flagsFileName;
     _defaultConfig      = defaultConfig;
     _inisLocator        = inisLocator;
     _configLoader       = configLoader;
     _logger             = logger;
 }
コード例 #2
0
        public CreationKitConfigInfo LoadConfig(CreationKitIniLocations inis)
        {
            var configBuilder = new ConfigurationBuilder();

            foreach (var iniPath in inis.RelativeIniPaths)
            {
                configBuilder.AddIniFile(
                    Path.GetFullPath(Path.Combine(
                                         PathUtilities.Normalize(inis.CreationKitInstallPath),
                                         PathUtilities.Normalize(iniPath))),
                    true);
            }

            var configuration     = configBuilder.Build();
            var creationKitConfig = new CreationKitConfig();

            configuration.Bind(creationKitConfig);

            return(new CreationKitConfigInfo()
            {
                CreationKitInstallPath = inis.CreationKitInstallPath,
                Config = creationKitConfig
            });
        }