コード例 #1
0
ファイル: Main.cs プロジェクト: LaudableBauble/FIFALoungeMode
        /// <summary>
        /// If the user wants to add a game to the mix.
        /// </summary>
        private void OnAddGameMenuClick(object sender, EventArgs e)
        {
            //If there already is an add game form open, do nothing.
            if (_AddGameForm != null) { return; }

            //Display a form where the user can enter game data.
            _AddGameForm = new AddGame();
            _AddGameForm.Show();

            //Subscribe to its events.
            _AddGameForm.Closing += OnAddGameFormClose;
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: LaudableBauble/FIFALoungeMode
        /// <summary>
        /// When the add game form has been closed.
        /// </summary>
        /// <param name="o"></param>
        /// <param name="e"></param>
        private void OnAddGameFormClose(object o, EventArgs e)
        {
            //Redraw the boards.
            UpdateBoards();

            //Unsubscribe from the control and close it.
            _AddGameForm.Closing -= OnAddGameFormClose;
            _AddGameForm = null;
        }