public MainWindow()
        {
            InitializeComponent();
            InitGrid();

            Show();

            m_CurrentSudoku = new SudokuGrid(@"Grids/grid1.ss", this);
            m_CurrentSudoku.DisplayGrid();
        }
Beispiel #2
0
 public SudokuGrid(SudokuGrid sudokuGrid)
 {
     for (int i = 0; i < 9; i++)
     {
         for (int j = 0; j < 9; j++)
         {
             m_grid[i, j] = sudokuGrid.m_grid[i, j];
         }
     }
 }
        /// <summary>
        /// Charge un nouveau sudoku
        /// </summary>
        /// <param name="sender">Le button ayant appele cette fonction</param>
        /// <param name="e">Parametre supplementaire si necessaire</param>
        private void LoadSudokuClick(object sender, RoutedEventArgs e)
        {
            UpdateResultText(true, false, "");
            // Ouvre une fenetre de dialogue permetant d'allez chercher le sudoku
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter           = "Sudoku files (*.ss)|*.ss";
            openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);

            if (openFileDialog.ShowDialog() == true)
            {
                // Affichage et sauvegarde temporaire du sudoku chargé
                m_CurrentSudoku = new SudokuGrid(openFileDialog.FileName, this);
                ClearSudoku();
                m_CurrentSudoku.DisplayGrid();
            }
        }