示例#1
0
        public static PluginDomain GetPluginObject(this string PluginPath, List <string> InterfaceName)
        {
            PluginDomain pluginDomain = new PluginDomain(dll_name, PluginPath, InterfaceName);

            if (pluginDomain.isSuccess)
            {
                return(pluginDomain);
            }
            else
            {
                return(null);
            }
        }
示例#2
0
        public static List <PluginDomain> GetPluginObjects(this string PluginPath, List <string> InterfaceName)
        {
            List <PluginDomain> plugins = new List <PluginDomain>();

            string[] PluginFiles = Directory.GetFiles(PluginPath);
            foreach (string file in PluginFiles)
            {
                //判断文件格式是否为.dll格式
                if (Path.GetExtension(file).ToLower() == ".dll")
                {
                    PluginDomain pluginDomain = new PluginDomain(dll_name, file, InterfaceName);
                    if (pluginDomain.isSuccess)
                    {
                        plugins.Add(pluginDomain);
                    }
                }
            }

            return(plugins);
        }