/// <summary> /// <para>Method used either for creating new instance of PlayerForm class</para> /// <para>and assigning it to the plForm variable</para> /// <para>or focusing on existing PlayerForm object</para> /// </summary> public static void PlayerFormsNew() { if (plForm == null) { plForm = new PlayerForm(); plForm.Show(); } else { plForm.Focus(); } }
/// <summary> /// Handler for FormClosed event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> internal void OnFormClosed(object sender, EventArgs e) { _formCount--; MessageBox.Show("Форма закрыта"); if (_formCount <= 0) { ExitThread(); } switch (sender) { case PlayerForm p: plForm = null; return; case TeamForm t: tmForm = null; return; } }
/// <summary> /// Method that enables run first form (PlayerForm currently) and the whole app accordingly. /// </summary> internal void Run() { plForm = new PlayerForm(); plForm.Show(); }