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