/// <summary> /// 根据实例名创建相应的配置实例。 /// </summary> /// <param name="node">Section节点。</param> /// <returns>返回相应类型的配置实例。</returns> private static IInstanceConfigurationSetting CreateDataInstanceSetting(XmlNode node) { var handerType = Type.GetType(node.GetAttributeValue("handlerType"), false, true); var handler = handerType != null?handerType.New <IConfigurationSettingParseHandler>() : InstanceParseHandleFactory.GetParseHandler(node.GetAttributeValue("storeType")); if (handler != null) { return(handler.Parse(node) as IInstanceConfigurationSetting); } return(null); }
/// <summary> /// 根据实例名创建相应的配置实例。 /// </summary> /// <param name="configuration">Section节点。</param> /// <returns>返回相应类型的配置实例。</returns> private static IInstanceConfigurationSetting CreateDataInstanceSetting(IConfiguration configuration) { var typeName = configuration.GetSection("handlerType").Value; var handerType = string.IsNullOrEmpty(typeName) ? null : Type.GetType(typeName, false, true); var handler = handerType != null?handerType.New <IConfigurationSettingParseHandler>() : InstanceParseHandleFactory.GetParseHandler(configuration.GetSection("storeType").Value); if (handler != null) { return(handler.Parse(configuration) as IInstanceConfigurationSetting); } return(null); }