Exemplo n.º 1
0
        /// <summary>
        /// 获得本地模块列表
        /// </summary>
        /// <param name="Path"></param>
        /// <param name="DLLName"></param>
        /// <returns></returns>
        private ModuleFunctionsPool GetLocalAllModules()
        {
            try
            {
                ModuleFunctionsPool module = new ModuleFunctionsPool();

                string Path = AppDomain.CurrentDomain.BaseDirectory;

                List <DirectoryCatalogModel> dcs = new List <DirectoryCatalogModel>();

                foreach (string filename in DevelopmentEnvironment.lstDLL)
                {
                    dcs.Add(new DirectoryCatalogModel(Path, filename + ".dll"));
                }
                //插件目录,在app.config中配置
                string PlugPath = System.Configuration.ConfigurationManager.AppSettings["ModulePath"];
                if (!String.IsNullOrEmpty(PlugPath))
                {
                    dcs.Add(new DirectoryCatalogModel(String.Format("{0}{1}\\", Path, PlugPath)));
                }

                return(ModuleHelper.GetLocalAllModules(dcs));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }