예제 #1
0
        /// <summary>
        /// Действия при присваивании значения ячейке
        /// </summary>
        /// <param name="value"></param>
        private void SetNewValue(int value)
        {
            Cell oldCell = cells[currentCell.X, currentCell.Y].Clone();

            cells[currentCell.X, currentCell.Y].CellText = value;
            Cell newCell = cells[currentCell.X, currentCell.Y].Clone();

            if (typeAction == TypeAction.game)
            {
                historyClass.AddStep(oldCell, newCell);
            }

            bool isAllFilled = true;

            for (int i = 0; i < 9; i++)
            {
                for (int j = 0; j < 9; j++)
                {
                    if (cells[i, j].CellType == CellType.clear ||
                        cells[i, j].CellType == CellType.smartLabel)
                    {
                        isAllFilled = false;
                        j           = i = 10;
                    }
                }
            }

            if (isAllFilled)
            {
                check_Click(null, null);
            }
        }