示例#1
0
 private void GoToFrom(SystemMenu menu, object action)
 {
     if (menu != null)
     {
         IVX.Live.MainForm.UILogics.FormBase f = c.GetContentPage(menu.URL);
         if (f == null)
         {
             return;
         }
         //if (menu.IsDialog)
         //{
         //    f.WindowState = FormWindowState.Normal;
         //    //f.Size = this.Size;
         //    f.StartPosition = FormStartPosition.CenterParent;
         //    f.ShowDialog();
         //}
         //else
         {
             f.MdiParent = this;
             //this.ActivateMdiChild(f);
             m_currentForm = menu;
             f.Show();
             f.Activate();
             if (action != null)
             {
                 f.DoAction(action);
             }
         }
     }
 }
示例#2
0
 private void GoToFrom(SystemMenu menu, object action)
 {
     if (menu != null)
     {
         IVX.Live.MainForm.UILogics.FormBase f = c.GetContentPage(menu.URL);
         if (f == null)
         {
             return;
         }
         //if (menu.IsDialog)
         //{
         //    f.WindowState = FormWindowState.Normal;
         //    //f.Size = this.Size;
         //    f.StartPosition = FormStartPosition.CenterParent;
         //    f.ShowDialog();
         //}
         //else
         {
             f.MdiParent = this;
             //this.ActivateMdiChild(f);
             labelX2.Text  = "当前位置:" + menu.Title;
             m_currentForm = menu;
             f.Size        = new Size(this.Width - panelEx4.Width, panelEx4.Height + 20);
             f.Show();
             f.Activate();
             if (action != null)
             {
                 f.DoAction(action);
             }
         }
         //if (!string.IsNullOrEmpty(menu.ParentURL))
         //{
         //    IVX.Live.MainForm.UILogics.FormBase f1 = c.GetContentPage(menu.ParentURL);
         //    f1.MdiParent = this;
         //    this.ActivateMdiChild(f1);
         //    f1.Show();
         //    f1.UpdateUI();
         //}
         string parentMenu = "";
         Dictionary <string, List <SystemMenu> > dt = Framework.Environment.GetSystemMenu();
         foreach (var item in dt)
         {
             foreach (SystemMenu it in item.Value)
             {
                 if (it.URL == menu.URL)
                 {
                     parentMenu = item.Key; break;
                 }
             }
             if (!string.IsNullOrEmpty(parentMenu))
             {
                 break;
             }
         }
         if (!string.IsNullOrEmpty(parentMenu))
         {
             sideBar1.GetItem("sideBarPanelItem" + parentMenu).Expanded = true;
         }
     }
 }