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