Ejemplo n.º 1
0
        /// <summary>
        /// Show and create a add goal form.
        /// </summary>
        /// <param name="profile">The profile that scored the goal.</param>
        private void ShowAddGoalForm(Profile profile)
        {
            //If there already is an add goal form open, do nothing.
            if (_AddGoalForm != null) { return; }

            //Create a form and show it to the user.
            _AddGoalForm = new AddGoal(profile);
            _AddGoalForm.Show();

            //Subscribe to its events.
            _AddGoalForm.Button.Click += OnbtnAddGoalFormClick;
            _AddGoalForm.FormClosing += OnAddGoalFormClose;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// When the add game form closes.
 /// </summary>
 /// <param name="o"></param>
 /// <param name="e"></param>
 private void OnAddGoalFormClose(object o, EventArgs e)
 {
     //Unsubscribe from the control and close it.
     _AddGoalForm.Button.Click -= OnbtnAddGoalFormClick;
     _AddGoalForm.Closing -= OnAddGoalFormClose;
     _AddGoalForm = null;
 }