示例#1
0
        private void InitConfiguredPlugins(string moduleKey, string configFile, ICachingService cachingService)
        {
            //Init the kraft module configurations model
            ModuleSettings = new KraftModuleConfigurationSettings(_DependencyInjectionContainer, cachingService, _KraftGlobalConfigurationSettings);

            //read the module configuration
            IConfigurationBuilder configbuilder = new ConfigurationBuilder();

            configbuilder.SetBasePath(Path.GetDirectoryName(configFile)).AddJsonFile(configFile);
            IConfigurationRoot configurationRoot = configbuilder.Build();

            configurationRoot.Bind("KraftModuleConfigurationSettings", ModuleSettings);

            ModuleSettings.LoadDefinedObjects(moduleKey, configFile);
        }
示例#2
0
        private void InitConfiguredPlugins(string moduleKey, string configFile, ICachingService cachingService)
        {
            if (!File.Exists(configFile))
            {
                throw new FileNotFoundException($"The {configFile} file was not found!");
            }

            //Init the kraft module configurations model
            ModuleSettings = new KraftModuleConfigurationSettings(_DependencyInjectionContainer, cachingService);

            //read the module configuration
            IConfigurationBuilder configbuilder = new ConfigurationBuilder();

            configbuilder.SetBasePath(Path.GetDirectoryName(configFile)).AddJsonFile(configFile);
            IConfigurationRoot configurationRoot = configbuilder.Build();

            configurationRoot.Bind("KraftModuleConfigurationSettings", ModuleSettings);

            ModuleSettings.LoadDefinedObjects(moduleKey, configFile);
        }