Exemplo n.º 1
0
        private void TimerOnTick(object sender, EventArgs eventArgs)
        {
            var play_res = current_tournament.DoNextPlay();

            TournamentListB.SelectedIndex = TournamentListB.Items.Count - 1;
            TournamentListB.ScrollIntoView(TournamentListB.SelectedItem);
            if (!play_res)
            {
                ((DispatcherTimer)sender).Stop();
                MessageBox.Show("This Tournament is ended", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Exemplo n.º 2
0
 private void PlayBut_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (!current_tournament.DoNextPlay())
         {
             MessageBox.Show("This Game is ended", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
         }
         TournamentListB.SelectedIndex = TournamentListB.Items.Count - 1;
         TournamentListB.ScrollIntoView(TournamentListB.SelectedItem);
     }
     catch (Exception)
     {
         MessageBox.Show("This Game is ended", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Exemplo n.º 3
0
 private void matchBut_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (!current_tournament.StartNewMatch())
         {
             MessageBox.Show("This Match is ended", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
         }
         TournamentListB.SelectedIndex = TournamentListB.Items.Count - 1;
         TournamentListB.ScrollIntoView(TournamentListB.SelectedItem);
     }
     catch (Exception)
     {
         MessageBox.Show("This Match is ended", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
     }
 }