private void rbwinform_CheckedChanged(object sender, EventArgs e) { cbpname.DisplayMember = "name"; cbpname.ValueMember = "name"; string entryplugin, entrycontroller; if (rbwinform.Checked) { cbpname.DataSource = plist.FindAll(x => x.plugintype == "WinformModulePlugin"); PluginSysManage.GetWinformEntry(out entryplugin, out entrycontroller); } else { cbpname.DataSource = plist.FindAll(x => x.plugintype == "WcfModulePlugin"); PluginSysManage.GetWcfClientEntry(out entryplugin, out entrycontroller); } cbpname.SelectedValue = entryplugin; txtcname.Text = entrycontroller; }
public void loadTitle() { this.Text = "efwplus Studio(插件开发工具)"; string appconfig = CommonHelper.WinformPlatformPath + "\\EFWWin.exe.config"; XmlDocument xmlDoc_app = new System.Xml.XmlDocument(); xmlDoc_app.Load(appconfig); string netwebserver = CommonHelper.AppRootPath + "\\NetWebServer.exe.config"; XmlDocument xmlDoc_webserver = new System.Xml.XmlDocument(); xmlDoc_webserver.Load(netwebserver); XmlNode node = xmlDoc_app.DocumentElement.SelectSingleNode("appSettings/add[@key='ClientType']"); if (node != null) { string ClientType = node.Attributes["value"].Value; if (ClientType == "Winform") { PluginSysManage.pluginsysFile = CommonHelper.WinformPlatformPath + "\\Config\\pluginsys.xml"; PluginSysManage.GetWinformEntry(out entryplugin, out entrycontroller); } else if (ClientType == "WCFClient") { PluginSysManage.pluginsysFile = CommonHelper.WinformPlatformPath + "\\Config\\pluginsys.xml"; PluginSysManage.GetWcfClientEntry(out entryplugin, out entrycontroller); } } node = xmlDoc_webserver.DocumentElement.SelectSingleNode("appSettings/add[@key='defaultpage']"); if (node != null) { starturl = node.Attributes["value"].Value; } //this.Text = "efwplus开发平台" + " " + "当前启动插件[" + entryplugin + "] 控制器[" + entrycontroller + "]"; labelItemtitle.Text = "Win启动项:[" + entryplugin + "@" + entrycontroller + "] Web启动项:[" + starturl + "]"; }
static void AppGlobal_Init(object sender, EventArgs e) { try { AppGlobal.AppStart(); if (missingDll.Count > 0) { string msg = "缺失的程序集:\r"; for (int i = 0; i < missingDll.Count; i++) { msg += missingDll[i] + "\r"; } MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } string entryplugin; string entrycontroller; switch (appType) { case AppType.Winform: #if WinfromFrame PluginSysManage.GetWinformEntry(out entryplugin, out entrycontroller); EFWCoreLib.WinformFrame.Controller.WinformController controller = EFWCoreLib.WinformFrame.Controller.ControllerHelper.CreateController(entryplugin + "@" + entrycontroller); //controller.Init(); if (controller == null) { throw new Exception("插件配置的启动项(插件名或控制器名称)不正确!"); } ((System.Windows.Forms.Form)controller.DefaultView).Show(); winfromMain.MainForm = ((System.Windows.Forms.Form)controller.DefaultView); #endif break; case AppType.WCFClient: #if WcfFrame PluginSysManage.GetWcfClientEntry(out entryplugin, out entrycontroller); EFWCoreLib.WcfFrame.ClientController.WcfClientController wcfcontroller = EFWCoreLib.WcfFrame.ClientController.ControllerHelper.CreateController(entryplugin + "@" + entrycontroller); if (wcfcontroller == null) { throw new Exception("插件配置的启动项(插件名或控制器名称)不正确!!"); } EFWCoreLib.WcfFrame.ClientController.ReplyClientCallBack callback = new WcfFrame.ClientController.ReplyClientCallBack(); EFWCoreLib.WcfFrame.ClientController.WcfClientManage.CreateConnection(callback); //wcfcontroller.Init(); ((System.Windows.Forms.Form)wcfcontroller.DefaultView).Show(); winfromMain.MainForm = ((System.Windows.Forms.Form)wcfcontroller.DefaultView); #endif break; } } catch (Exception err) { //记录错误日志 ZhyContainer.CreateException().HandleException(err, "HISPolicy"); //Application.Exit(); //throw new Exception(err.Message + "\n\n请联系管理员!"); MessageBox.Show(err.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); AppExit(); } }