HandsOff/TeamCreatorPage.xaml.cs
/// <summary>
/// When invoked creates a new custom-made team on button click.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
When invoked creates a new custom-made team on button click.
When invoked creates a new custom - made team on button click .
private async void CreateTeam_Click(object sender, RoutedEventArgs e)
        {
            if (TeamNameBox.Text == "")
            {
                MessageDialog showDialog = new MessageDialog("Please enter a team name.");
                showDialog.Commands.Add(new UICommand("Ok")
                {
                    Id = 0
                });
                showDialog.DefaultCommandIndex = 0;
                IUICommand result = await showDialog.ShowAsync();
                if ((int)result.Id == 0)
                {
                    return;
                }
            }
            else
            {
                App.Teams.Add(CreateCustomTeam());
                MessageDialog showDialog = new MessageDialog("Team " + TeamNameBox.Text + " has been created!");
                showDialog.Commands.Add(new UICommand("Ok")
                {
                    Id = 0
                });
                showDialog.DefaultCommandIndex = 0;
                IUICommand result = await showDialog.ShowAsync();
                if ((int)result.Id == 0)
                {
                    return;
                }
            }
        }
private async void CreateTeam_Click ( object sender , RoutedEventArgs e ) { if ( TeamNameBox . Text == " " ) { MessageDialog showDialog = new MessageDialog ( " " ) ; showDialog . Commands . Add ( new UICommand ( " " ) { Id = 0 } ) ; showDialog . DefaultCommandIndex = 0 ; IUICommand result = await showDialog . ShowAsync ( ) ; if ( ( int ) result . Id == 0 ) { return ; } } else { App . Teams . Add ( CreateCustomTeam ( ) ) ; MessageDialog showDialog = new MessageDialog ( " " + TeamNameBox . Text + " " ) ; showDialog . Commands . Add ( new UICommand ( " " ) { Id = 0 } ) ; showDialog . DefaultCommandIndex = 0 ; IUICommand result = await showDialog . ShowAsync ( ) ; if ( ( int ) result . Id == 0 ) { return ; } } }
When invoked creates a new custom-made team on button click.
When invoked creates a new custom - made team on button click .
// Show message dialog when no team name has been entered // Show message dialog when a custom team has been created
sender
object
None
e
RoutedEventArgs
None