public void RefeshPage() { if (lastPage != null) { Save(); ChildPage childPage = SharedFunc.LoadPage(lastPage.SysMenu); childPage.MdiParent = this.MdiParent; childPage.Show(); } }
private void MyTree_DoubleClick(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; sw.Restart(); List <Sys_Menu> MenuData = (List <Sys_Menu>)Provider.UserMenus; Sys_Menu sys_Menu = MenuData[MyTree.FocusedNode.Id]; if (string.IsNullOrEmpty(sys_Menu.Menu_Page)) { return; } if (!IsMenuOpen(sys_Menu)) { ImageCollection ims = (ImageCollection)MyTree.SelectImageList; if (ims != null) { barTip.ImageOptions.Image = ims.Images[sys_Menu.Menu_IconIndex];// MyTree.FocusedNode.ImageIndex sys_Menu.Menu_IconIndex; } Sys_Menu sys_Page = InitializePage(sys_Menu); if (sys_Page != null) { ChildPage myPage = SharedFunc.LoadPage(sys_Page); if (myPage == null) { myPage = new ChildPage(); } myPage.SysMenu = sys_Menu; switch ((Sys_Menu_Show)sys_Page.Menu_Show) { case Sys_Menu_Show.MdiChild: myPage.MdiParent = this; myPage.Show(); break; case Sys_Menu_Show.Dialog: myPage.ShowDialog(); break; case Sys_Menu_Show.NewForm: myPage.Show(); break; default: break; } } } barTip.Caption = TimeDiff(sw); barTip.Hint = string.Empty; } catch (Exception ex) { SharedFunc.RaiseError(ex); } finally { this.Cursor = Cursors.Default; } }