コード例 #1
0
        /// <summary>
        /// 从单独的Meta.config文件中读取Meta配置
        /// </summary>
        /// <param name="settings"></param>
        /// <returns></returns>
        private static MetaSourceMappingsConfigurationSection LoadMetaSourceInstanceSectionFromMetaFile(ConfigFilesSetting settings)
        {
            System.Configuration.Configuration config = GetSingleFileConfiguration(settings.MetaConfigurationFile);

            MetaConfigurationSectionGroup group =
                config.GetSectionGroup(MetaConfigurationSectionGroupItem) as MetaConfigurationSectionGroup;
            MetaSourceMappingsConfigurationSection section = null;

            if (group != null)
            {
                section = group.SourceMappings;
            }
            return(section);
        }
コード例 #2
0
        /// <summary>
        /// 从本地config文件中读取meta配置
        /// </summary>
        /// <param name="settings"></param>
        /// <returns></returns>
        private static MetaSourceMappingsConfigurationSection LoadMetaSourceInstanceSectionFromLocal(ConfigFilesSetting settings)
        {
            System.Configuration.Configuration config = CoreHelper.EnvironmentHelper.Mode == EnumInstanceMode.Web
                                ? GetStandardWebConfiguration(settings.MetaConfigurationFile)
                                : getStandardExeConfiguration(settings.MachineConfigurationFile, LocalConfigurationFile);

            MetaConfigurationSectionGroup group =
                config.GetSectionGroup(MetaConfigurationSectionGroupItem) as MetaConfigurationSectionGroup;
            MetaSourceMappingsConfigurationSection section = null;

            if (group != null)
            {
                section = group.SourceMappings;
            }
            return(section);
        }