Ejemplo n.º 1
0
 // This isn't fundamentally different from the QueryCellInfo in BlocksForm, except that
 // game.GetNextPiece() is used instead.
 private void gridNextPiece_QueryCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs e)
 {
     e.Style.Enabled = false;
     if (e.ColIndex > 0 && e.RowIndex > 0)
     {
         if (game.IsGameOver || !game.IsGameRunning || !game.IsGameStarted)
         {
             e.Style.BackColor = Color.White;
         }
         else
         {
             e.Style.Interior = BlocksForm.GetGradient(game.GetNextPiece()[e.ColIndex - 1, e.RowIndex - 1]);
         }
     }
 }