コード例 #1
0
 private void addNewPlayerButton_Click(object sender, RoutedEventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(newPlayerTextBox.Text))
     {
         _gameOptions.AddPlayer(newPlayerTextBox.Text);
     }
     newPlayerTextBox.Text = string.Empty;
 }
コード例 #2
0
ファイル: StartGame.xaml.cs プロジェクト: GyPapi/BegVCSharp
 private void addNewPlayerButton_Click(object sender, RoutedEventArgs e)
 {
     // Check if a non-empty string has been entered in the textbox. If so, add it to the
     // list of player names.
     if (!string.IsNullOrWhiteSpace(newPlayerTextBox.Text))
     {
         _gameOptions.AddPlayer(newPlayerTextBox.Text);
     }
     newPlayerTextBox.Text = string.Empty;
 }