Beispiel #1
0
        private void btnArriaved_Click(object sender, EventArgs e)
        {
            Athlte t = new Athlte()
            {
                AthleteID = counter, AthleteName = "Athlete " + counter
            };

            counter++;
            tq.Enqueue(t);
            RefreshLabel();
        }
Beispiel #2
0
 private void btnDeparted_Click(object sender, EventArgs e)
 {
     try
     {
         Athlte returnTeam = tq.Dequeue();
         RefreshLabel();
         lblComp.Text = returnTeam.ToString();
     }
     catch (TimedOutException te)
     {
         MessageBox.Show(te.Message);
     }
     catch (InvalidOperationException ioe)
     {
         MessageBox.Show(ioe.Message);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }