Exemplo n.º 1
0
 void OnSeatUpdated_Console(object sender, SeatEventArgs e)
 {
     if (InvokeRequired)
     {
         // We're not in the UI thread, so we need to call BeginInvoke
         BeginInvoke(new EventHandler<SeatEventArgs>(OnSeatUpdated_Console), new[] { sender, e });
         return;
     }
     var s = e.Seat;
     if(e.Seat.IsEmpty)
         WriteLine("The seat #" + s.NoSeat + " is now inoccupied");
     else
         WriteLine(s.Player.Name + " sat in at seat #" + s.NoSeat);
 }
Exemplo n.º 2
0
 void OnSeatUpdated(object sender, SeatEventArgs e)
 {
     if (InvokeRequired)
     {
         // We're not in the UI thread, so we need to call BeginInvoke
         BeginInvoke(new EventHandler<SeatEventArgs>(OnSeatUpdated), new[] { sender, e });
         return;
     }
     SuspendLayout();
     if( e.Seat.IsEmpty)
         m_Huds[e.Seat.NoSeat].Visible = false;
     else
         InstallPlayer(m_Huds[e.Seat.NoSeat], e.Seat);
     ResumeLayout();
 }