示例#1
0
文件: UIManager.cs 项目: corefan/yad2
 private void ThreadStartFunction()
 {
     actualForm = FormPool.GetForm(Views.MainMenuForm);
     //reset handler
     actualForm.MenuOptionChange -= menuEventHandler;
     actualForm.MenuOptionChange += menuEventHandler;
     actualForm.MessageBoxShow   -= messageBoxEventHandler;
     actualForm.MessageBoxShow   += messageBoxEventHandler;
     actualForm.Show();
 }
示例#2
0
文件: UIManager.cs 项目: corefan/yad2
        private void switchView(Views viewToSwitch, bool hideLast, bool modal)
        {
            if (hideLast)
            {
                actualForm.Hide();
            }

            actualView = viewToSwitch;
            actualForm = FormPool.GetForm(viewToSwitch);

            //reset handler
            actualForm.MenuOptionChange -= menuEventHandler;
            actualForm.MenuOptionChange += menuEventHandler;
            actualForm.MessageBoxShow   -= messageBoxEventHandler;
            actualForm.MessageBoxShow   += messageBoxEventHandler;


            if (actualForm.InvokeRequired)
            {
                actualForm.Invoke(new TopMostEventHandler(SetFormTopMost), new object[] { actualForm, modal });
            }
            else
            {
                SetFormTopMost(actualForm, modal);
            }

            if (actualForm.Visible == false)
            {
                if (actualForm.InvokeRequired)
                {
                    actualForm.Invoke(new FormShowEventHandler(actualForm.Show), new object[] { mainForm });
                }
                else
                {
                    actualForm.Show(mainForm);
                }
            }
        }