示例#1
0
 public AnimateGrid(exDGV lifeGrid)
 {
     _lifeGridControl = lifeGrid;
     for (var count = 0; count <= 99; count++)
     {
         _cells[count] = new int[100];
     }
 }
示例#2
0
        public void Test_That_Cancel_Stays_False_On_Creating_Grid()
        {
            //Arrange
            var lifeGridControl = new exDGV();

            //Act
            var animateGrid = new AnimateGrid(lifeGridControl);

            //Assert
            Assert.AreEqual(animateGrid.Cancelled, false);
        }
示例#3
0
 public static void Paint(exDGV lifeGridControl, bool cancelled, int totalCellCount, IReadOnlyList <int[]> cells)
 {
     //loop through current grid and set back color of cells
     if (cancelled)
     {
         return;
     }
     for (var count1 = 0; count1 <= totalCellCount; count1++)
     {
         for (var count2 = 0; count2 <= totalCellCount; count2++)
         {
             lifeGridControl.Rows[count1].Cells[count2].Style.BackColor =
                 cells[count1][count2] > 0 ? Color.Black : Color.White;
         }
     }
 }