예제 #1
0
        private void mi_open_Click(object sender, EventArgs e)
        {
            Game g = Saver.Load();

            game.LoadGameInstance(g);

            // Updating the dvg grid
            CopyGridIntoDVG();
            if (game.SudokuGrid != null)
            {
                for (int i = 0; i < Grid.NB_COLUMNS; i++)
                {
                    for (int j = 0; j < Grid.NB_COLUMNS; j++)
                    {
                        if (game.SudokuGrid[i, j] != null)
                        {
                            dvg_grid[i, j].ReadOnly = game.SudokuGrid[i, j].ReadOnly;
                        }
                    }
                }
            }

            for (int i = 0; i < dvg_grid.ColumnCount; i++)
            {
                for (int j = 0; j < dvg_grid.RowCount; j++)
                {
                    dvg_grid[i, j].Style.BackColor = SystemColors.Window;
                    if (game.SudokuGrid[i, j].ReadOnly)
                    {
                        dvg_grid[i, j].ReadOnly        = true;
                        dvg_grid[i, j].Style.ForeColor = SystemColors.ControlDarkDark;
                    }
                    else
                    {
                        dvg_grid[i, j].ReadOnly        = false;
                        dvg_grid[i, j].Style.ForeColor = SystemColors.WindowText;
                    }
                }
            }
        }
예제 #2
0
 private void mi_save_Click(object sender, EventArgs e)
 {
     Saver.Save(game);
 }