/// <summary> /// 合并模块信息 /// </summary> /// <param name="pPluginCollection">模块集合</param> public void Merge(PlugInCollection pPluginCollection) { foreach (PlugInInfo pPlugin in pPluginCollection) { this.pPlugInList.Add(pPlugin); } }
/// <summary> /// 反射加载方法 /// </summary> /// <param name="strPath">路径</param> /// <param name="strSuffix">扩展名</param> /// <param name="strLibrary">模块名称</param> /// <returns>模块列表</returns> public PlugInCollection LoadAssembly(string strPath, string strSuffix, string strLibrary) { PlugInCollection pPluginCollection = new PlugInCollection(); Assembly pAssembly = Assembly.LoadFile(strPath + "\\" + strLibrary + "." + strSuffix); foreach (Type pType in pAssembly.GetTypes()) { pPluginCollection.Add(strLibrary, pType); } return(pPluginCollection); }