Ejemplo n.º 1
0
 private void ThreadStartFunction()
 {
     actualForm = FormPool.GetForm(Views.MainMenuForm);
     //reset handler
     actualForm.MenuOptionChange -= menuEventHandler;
     actualForm.MenuOptionChange += menuEventHandler;
     actualForm.MessageBoxShow   -= messageBoxEventHandler;
     actualForm.MessageBoxShow   += messageBoxEventHandler;
     actualForm.Show();
 }
Ejemplo n.º 2
0
        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);
                }
            }
        }