private void ShowAccountForm() { if (accountForm != null) { accountForm.Activate(); accountForm.Update(); if (accountForm.WindowState == FormWindowState.Minimized) { accountForm.WindowState = FormWindowState.Normal; } } else { accountForm = new AccountForm(controller); accountForm.Show(); accountForm.Activate(); accountForm.BringToFront(); accountForm.FormClosed += accountForm_FormClosed; } }
void accountForm_FormClosed(object sender, FormClosedEventArgs e) { accountForm = null; Util.Utils.ReleaseMemory(); }