示例#1
0
        public void Load(PluginSectionHandler plugin, string plugfile)
        {
            if (plugin != null)
            {
                if (baseinfoDataList == null)
                {
                    baseinfoDataList = new List <baseinfoData>();
                }

                name            = plugin.name;
                version         = plugin.version;
                title           = plugin.title;
                author          = plugin.author;
                plugintype      = plugin.plugintype;
                defaultdbkey    = plugin.defaultdbkey;
                defaultcachekey = plugin.defaultcachekey;

                foreach (baseinfoData data in plugin.baseinfo)
                {
                    if (baseinfoDataList.FindIndex(x => x.key == data.key) == -1)
                    {
                        baseinfoDataList.Add(data);
                    }
                }
            }
        }
示例#2
0
        public void Load(PluginSectionHandler plugin, string plugfile)
        {
            if (plugin != null)
            {
                if (baseinfoDataList == null)
                {
                    baseinfoDataList = new List <baseinfoData>();
                }
                if (businessinfoDllList == null)
                {
                    businessinfoDllList = new List <businessinfoDll>();
                }

                name            = plugin.name;
                version         = plugin.version;
                title           = plugin.title;
                author          = plugin.author;
                plugintype      = plugin.plugintype;
                defaultdbkey    = plugin.defaultdbkey;
                defaultcachekey = plugin.defaultcachekey;

                foreach (baseinfoData data in plugin.baseinfo)
                {
                    if (baseinfoDataList.FindIndex(x => x.key == data.key) == -1)
                    {
                        baseinfoDataList.Add(data);
                    }
                }

                foreach (businessinfoDll dll in plugin.businessinfo)
                {
                    if (businessinfoDllList.FindIndex(x => x.name == dll.name) == -1)
                    {
                        bool exists = false;
                        //if (plugintype.ToLower() == "winform" || plugintype.ToLower() == "wcf")
                        //{
                        //    exists = new FileInfo(AppGlobal.AppRootPath + dll.name).Exists;
                        //}
                        //else if (plugintype.ToLower() == "web")
                        //{
                        //    exists = new FileInfo(AppGlobal.AppRootPath +"bin\\" + dll.name).Exists;
                        //}
                        string dllpath = new System.IO.FileInfo(plugfile).DirectoryName + "\\dll";
                        exists = new FileInfo(dllpath + "\\" + dll.name).Exists;

                        if (exists)
                        {
                            businessinfoDllList.Add(dll);
                        }
                        else//没有编译的dll记录并提示
                        {
                            AppGlobal.missingDll.Add(dll.name);
                        }
                    }
                }
            }
        }
        public void Add(PluginSectionHandler plugin)
        {
            if (plugin != null)
            {
                if (baseinfoDataList == null) baseinfoDataList = new List<baseinfoData>();
                if (businessinfoDllList == null) businessinfoDllList = new List<businessinfoDll>();

                name = plugin.name;
                version = plugin.version;
                title = plugin.title;
                author = plugin.author;
                plugintype = plugin.plugintype;
                defaultdbkey = plugin.defaultdbkey;
                defaultcachekey = plugin.defaultcachekey;

                foreach (baseinfoData data in plugin.baseinfo)
                {
                    if (baseinfoDataList.FindIndex(x => x.key == data.key) == -1)
                        baseinfoDataList.Add(data);
                }

                foreach (businessinfoDll dll in plugin.businessinfo)
                {
                    if (businessinfoDllList.FindIndex(x => x.name == dll.name) == -1)
                    {
                        bool exists = false;
                        if (plugintype.ToLower() == "winform" || plugintype.ToLower() == "wcf")
                        {
                            exists = new FileInfo(AppGlobal.AppRootPath + dll.name).Exists;
                        }
                        else if (plugintype.ToLower() == "web")
                        {
                            exists = new FileInfo(AppGlobal.AppRootPath +"bin\\" + dll.name).Exists;
                        }

                        if (exists)
                            businessinfoDllList.Add(dll);
                        else//没有编译的dll记录并提示
                            AppGlobal.missingDll.Add(dll.name);
                    }
                }
            }
        }