/// <summary> /// If the user wants to edit the teams. /// </summary> private void OnEditTeamsMenuClick(object sender, EventArgs e) { //If there already is an edit teams form open, do nothing. if (_EditTeamsForm != null) { return; } //Display a form where the user can enter game data. _EditTeamsForm = new EditTeams(); _EditTeamsForm.Show(); //Subscribe to its events. _EditTeamsForm.Closing += OnEditTeamsFormClose; }
/// <summary> /// When the edit teams form has been closed. /// </summary> /// <param name="o"></param> /// <param name="e"></param> private void OnEditTeamsFormClose(object o, EventArgs e) { //Unsubscribe from the control and close it. _EditTeamsForm.FormClosing -= OnEditTeamsFormClose; _EditTeamsForm = null; }