private void btnEditPlayer_Click(object sender, EventArgs e) { using (PlayerEditor playerEditor = new PlayerEditor(Player)) { playerEditor.ShowDialog(); } }
/// <summary> /// Event handler that executes when user clicks on Add Player tool strip menu item. /// </summary> ///<para>Add player on game board.</para> /// <param name="sender"></param> /// <param name="e"></param> private void AddPlayerToolStripMenuItem_Click(object sender, EventArgs e) { PlayerStats playerStats = new PlayerStats(GameDataService.Instance.GameModel.CreateNewPlayer()); using (PlayerEditor playerEditor = new PlayerEditor(playerStats.Player)) { playerEditor.ShowDialog(); } flowLayoutPanel1.Controls.Add(playerStats); }