public void ShowForm(WinMenu menu) { Form form = null; if (string.IsNullOrEmpty(menu.PluginName) == false && string.IsNullOrEmpty(menu.ControllerName) == false) { string controllername = menu.ControllerName.Split(new char[] { '|' })[0]; string viewname = menu.ControllerName.Split(new char[] { '|' }).Length > 1 ? menu.ControllerName.Split(new char[] { '|' })[1] : null; if (controllername.Trim() == "") { throw new Exception("菜单没有配置好!"); } if (AppGlobal.appType == AppType.Winform) { WinformController basec = ControllerHelper.CreateController(menu.PluginName + "@" + controllername); if (string.IsNullOrEmpty(viewname)) { form = (Form)basec.DefaultView; } else { form = (Form)basec.iBaseView[viewname]; } } } ShowForm(form, menu.Name, menu.MenuId.ToString()); }
public void ShowForm(WinMenu menu) { Form form = null; if (string.IsNullOrEmpty(menu.PluginName) == false && string.IsNullOrEmpty(menu.ControllerName) == false) { string controllername = menu.ControllerName.Split(new char[] { '|' })[0]; string viewname = menu.ControllerName.Split(new char[] { '|' }).Length > 1 ? menu.ControllerName.Split(new char[] { '|' })[1] : null; if (AppGlobal.appType == AppType.Winform) { WinformController basec = ControllerHelper.CreateController(menu.PluginName + "@" + controllername); if (string.IsNullOrEmpty(viewname)) { form = (Form)basec.DefaultView; } else { form = (Form)basec.iBaseView[viewname]; } } } string tabId = "view" + form.GetHashCode(); ShowForm(form, menu.Name, tabId); }
public void ShowBrowser(string tabName, string url) { WinformController basec = ControllerHelper.CreateController("MainFrame.UI@wcfclientLoginController"); Form form = (Form)basec.iBaseView["FrmWebBrowser"]; (form as IfrmWebBrowserView).Url = url; (form as IfrmWebBrowserView).NavigateUrl(); string tabId = "view" + form.GetHashCode(); ShowForm(form, tabName, tabId); }
public void ShowForm(WinMenu menu) { Form form = null; if (string.IsNullOrEmpty(menu.PluginName) == false && string.IsNullOrEmpty(menu.ControllerName) == false) { string controllername = menu.ControllerName.Split(new char[] { '|' })[0]; string viewname = menu.ControllerName.Split(new char[] { '|' }).Length > 1 ? menu.ControllerName.Split(new char[] { '|' })[1] : null; if (AppGlobal.appType == AppType.Winform) { #if WinformFrame WinformController basec = ControllerHelper.CreateController(menu.PluginName + "@" + controllername); if (string.IsNullOrEmpty(viewname)) { form = (Form)basec.DefaultView; } else { form = (Form)basec.iBaseView[viewname]; } #endif } else if (AppGlobal.appType == AppType.WCFClient) { #if WcfFrame EFWCoreLib.WcfFrame.ClientController.WcfClientController basec = EFWCoreLib.WcfFrame.ClientController.ControllerHelper.CreateController(menu.PluginName + "@" + controllername); if (string.IsNullOrEmpty(viewname)) { form = (Form)basec.DefaultView; } else { form = (Form)basec.iBaseView[viewname]; } #endif } } ShowForm(form, menu.Name, menu.MenuId.ToString()); }
public void ShowForm(WinMenu menu) { Form form = null; if (string.IsNullOrEmpty(menu.PluginName) == false && string.IsNullOrEmpty(menu.ControllerName) == false) { string controllername = menu.ControllerName.Split(new char[] { '|' })[0]; string viewname = menu.ControllerName.Split(new char[] { '|' }).Length > 1 ? menu.ControllerName.Split(new char[] { '|' })[1] : null; if (controllername.Trim() == "") throw new Exception("配置的菜单不存在!"); WinformController basec = ControllerHelper.CreateController(controllername); if(basec==null) throw new Exception("配置的菜单不存在!"); if (string.IsNullOrEmpty(viewname)) form = (Form)basec.DefaultView; else { if (basec.iBaseView.ContainsKey(viewname) == false) throw new Exception("配置的菜单不存在!"); form = (Form)basec.iBaseView[viewname]; } } string tabId = "view" + form.GetHashCode(); ShowForm(form, menu.Name, tabId); }
public void ShowForm(WinMenu menu) { Form form = null; if (string.IsNullOrEmpty(menu.PluginName) == false && string.IsNullOrEmpty(menu.ControllerName) == false) { string controllername = menu.ControllerName.Split(new char[] { '|' })[0]; string viewname = menu.ControllerName.Split(new char[] { '|' }).Length > 1 ? menu.ControllerName.Split(new char[] { '|' })[1] : null; if (controllername.Trim() == "") { throw new Exception("菜单没有配置好!"); } if (AppGlobal.appType == AppType.Winform) { WinformController basec = ControllerHelper.CreateController(menu.PluginName + "@" + controllername); if (string.IsNullOrEmpty(viewname)) { form = (Form)basec.DefaultView; } else { form = (Form)basec.iBaseView[viewname]; } } } else if (string.IsNullOrEmpty(menu.UrlPath) == false)//打开浏览器 { WinformController basec = ControllerHelper.CreateController("MainFrame.UI@wcfclientLoginController"); form = (Form)basec.iBaseView["FrmWebBrowser"]; (form as IfrmWebBrowserView).Url = menu.UrlPath; (form as IfrmWebBrowserView).NavigateUrl(); } string tabId = "view" + form.GetHashCode(); ShowForm(form, menu.Name, tabId); }