Exemple #1
0
        /// <summary>
        /// 从ComponentFactory配置节点建立对象
        /// </summary>
        /// <param name="componentNodeName">配置节点名称</param>
        /// <param name="typeName">反射对象类型:不含父路径</param>
        /// <returns>构造的对象</returns>
        private static T GetPluginFromComponentNode(string componentNodeName, string typeName)
        {
            PluginUtils util = PluginConfig.GetComponentAssemblerInfo(componentNodeName);

            util.PluginName     = typeName;
            util.FullPluginName = util.FacadeNameSpace + "." + util.PluginName;
            return((T)PluginBuilder.GetPlugin(util.AssemblerName, util.FullPluginName));
        }
Exemple #2
0
        /// <summary>
        /// 通过反射构造对象
        /// </summary>
        /// <param name="componentNodeName">配置节点名称</param>
        /// <returns>构造的对象</returns>
        private static T GetPlugin(string componentNodeName)
        {
            T plugin = (T)PluginBuilder.GetPlugin(typeof(T));

            if (null == plugin)
            {
                string key = PluginUtils.ConcisionTypeName <T>();
                plugin = GetPluginFromComponentNode(componentNodeName, key);
            }
            return(plugin);
        }
Exemple #3
0
 /// <summary>
 /// 构造插件
 /// </summary>
 /// <returns>构造的对象</returns>
 private static T BuildPlugin()
 {
     return((T)PluginBuilder.GetPlugin(typeof(T)));
 }