void LoadpluginConfig() { filename = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, filename); if (File.Exists(filename))//如果存在独立文件 { var fileMap = new ExeConfigurationFileMap() { ExeConfigFilename = filename }; var config = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None); this.plugins = config.GetSection("plugin-section") as PluginsSection; this.dnyImages = config.GetSection("image-section") as ImageSection; } else { this.plugins = ConfigurationManager.GetSection("plugin-section") as PluginsSection; this.dnyImages = ConfigurationManager.GetSection("image-section") as ImageSection; } if (this.plugins == null) { isUsingDefaultConfig = true; } }
private ResourcePreInit() { section = new ConfigParser().Images; }