Esempio n. 1
0
        static void setprivatepath()
        {
            //AppDomain.CurrentDomain.SetupInformation.PrivateBinPath = @"Component;ModulePlugin\Books_Wcf\dll;ModulePlugin\WcfMainUIFrame\dll";
            string privatepath = @"Component";

            foreach (var p in PluginSysManage.GetAllPlugin())
            {
                privatepath += ";" + p.path.Replace("plugin.xml", "dll");
            }

            AppDomain.CurrentDomain.SetData("PRIVATE_BINPATH", privatepath);
            AppDomain.CurrentDomain.SetData("BINPATH_PROBE_ONLY", privatepath);
            var m       = typeof(AppDomainSetup).GetMethod("UpdateContextProperty", BindingFlags.NonPublic | BindingFlags.Static);
            var funsion = typeof(AppDomain).GetMethod("GetFusionContext", BindingFlags.NonPublic | BindingFlags.Instance);

            m.Invoke(null, new object[] { funsion.Invoke(AppDomain.CurrentDomain, null), "PRIVATE_BINPATH", privatepath });
        }
Esempio n. 2
0
        private void InitPlugin()
        {
            List <PluginClass> plist  = new List <PluginClass>();
            List <PluginClass> plist2 = PluginSysManage.GetAllPlugin();

            plist.AddRange(plist2.FindAll(x => (x.plugintype == "WcfModulePlugin")));

            for (int i = 0; i < plist.Count; i++)
            {
                FileInfo finfo = new FileInfo(PluginSysManage.localpath + "\\" + plist[i].path);
                PluginXmlManage.pluginfile = finfo.FullName;
                pluginxmlClass plugin = PluginXmlManage.getpluginclass();
                plist[i].version = plugin.version;
                plist[i].author  = plugin.author;
            }
            gridlocal.DataSource = plist;
        }