Beispiel #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);
             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;
         }
     }
 }
 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);
             }
         }
     }
 }
 void ctrl_FormClosed(object sender, FormClosedEventArgs e)
 {
     IVX.Live.MainForm.UILogics.FormBase tabPage = sender as IVX.Live.MainForm.UILogics.FormBase;
     tabPage.Controls.Remove(tabPage);
     m_DTFunction2TabPage.Remove(tabPage.Name);
     tabPage.Clear();
     //tabPage.Dispose();
 }
Beispiel #4
0
 private void buttonItem2_Click(object sender, EventArgs e)
 {
     IVX.Live.MainForm.UILogics.FormBase f = c.GetContentPage("FormAddLocalTask");
     f.WindowState   = FormWindowState.Normal;
     f.Size          = this.Size;
     f.StartPosition = FormStartPosition.CenterParent;
     f.ShowDialog();
     IVX.Live.MainForm.UILogics.FormBase f1 = c.GetContentPage("FormTaskManagement");
     f1.MdiParent = this;
     this.ActivateMdiChild(f1);
     f1.Show();
 }
 private IVX.Live.MainForm.UILogics.FormBase CreateContentPage(string itemInfo)
 {
     try
     {
         IVX.Live.MainForm.UILogics.FormBase ctrl
             = Assembly.GetExecutingAssembly().CreateInstance("IVX.Live.MainForm.View." + itemInfo) as IVX.Live.MainForm.UILogics.FormBase;
         //ctrl.FormClosed += ctrl_FormClosed;
         ctrl.Name = itemInfo;
         return(ctrl);
     }
     catch (Exception ex)
     {
         MyLog4Net.Container.Instance.Log.DebugWithDebugView("CreateContentPage iteminfo:" + itemInfo + " error:" + ex.ToString());
         return(null);
     }
 }
        public IVX.Live.MainForm.UILogics.FormBase GetContentPage(string itemInfo)
        {
            IVX.Live.MainForm.UILogics.FormBase tabPage = null;

            if (m_DTFunction2TabPage.ContainsKey(itemInfo))
            {
                tabPage = m_DTFunction2TabPage[itemInfo];
            }
            else
            {
                tabPage = CreateContentPage(itemInfo);
                if (tabPage != null)
                {
                    tabPage.WindowState       = FormWindowState.Maximized;
                    tabPage.EnableCustomStyle = true;
                    m_DTFunction2TabPage.Add(itemInfo, tabPage);
                }
            }

            return(tabPage);
        }
Beispiel #7
0
 private void DoLogin()
 {
     if (InvokeRequired)
     {
         this.Invoke(new Action(DoLogin));
     }
     else
     {
         IVX.Live.MainForm.UILogics.FormBase f = c.GetContentPage("FormLogin");
         f.WindowState   = FormWindowState.Normal;
         f.StartPosition = FormStartPosition.CenterParent;
         if (f.ShowDialog() != System.Windows.Forms.DialogResult.OK)
         {
             this.Close();
         }
         else
         {
             BuildMenu();
         }
     }
 }
Beispiel #8
0
 private void DoLogin()
 {
     if (InvokeRequired)
     {
         this.Invoke(new Action(DoLogin));
     }
     else
     {
         IVX.Live.MainForm.UILogics.FormBase f = c.GetContentPage(Framework.Environment.DefaultLoginPage.URL);
         f.WindowState   = FormWindowState.Normal;
         f.StartPosition = FormStartPosition.CenterParent;
         if (f.ShowDialog() != System.Windows.Forms.DialogResult.OK)
         {
             this.Close();
         }
         else
         {
             logOutBtn.Visible = true;
             BuildMenu();
             if (ocx_VodSdk_Init())
             {
                 Framework.Environment.VODPlayControler = axvodocx1;
             }
             if (ocx_BriefSdk_Init())
             {
                 Framework.Environment.BriefPlayControler = axbriefocx1;
             }
             IVX.Live.MainForm.UILogics.FormBase f1 = c.GetContentPage(Framework.Environment.DefaultViewPage.URL);
             m_viewModel.FormTree = new Stack <SystemMenu>();
             m_currentForm        = Framework.Environment.DefaultViewPage;
             f1.MdiParent         = this;
             this.ActivateMdiChild(f1);
             labelX2.Text = "当前位置:" + Framework.Environment.DefaultViewPage.Title;
             f1.Size      = new Size(this.Width - panelEx4.Width, panelEx4.Height + 20);
             f1.Show();
             timer1.Start();
             labelUser.Text = "您好," + Framework.Environment.CurUserInfo.UserName;
         }
     }
 }
Beispiel #9
0
        private void buttonItem_Click(object sender, EventArgs e)
        {
            ButtonItem bt = sender as ButtonItem;

            if (bt == null)
            {
                return;
            }
            SystemMenu menu = bt.Tag as SystemMenu;

            if (bt != 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);
                    f.Show();
                }
                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();
                }
            }
        }
 void RemovePage(string itemInfo, IVX.Live.MainForm.UILogics.FormBase tabPage)
 {
     tabPage.Clear();
 }
Beispiel #11
0
 private void buttonItem1_Click(object sender, EventArgs e)
 {
     IVX.Live.MainForm.UILogics.FormBase f = c.GetContentPage("FormTaskManagement");
     f.MdiParent = this;
     f.Show();
 }