WPF/MainWindow.xaml.cs
/// <summary>
/// Store application settings to user data
/// </summary>
Store application settings to user data
Store application settings to user data
private void SaveSettings()
        {
            Settings.Default.Name0 = BestNames[GameDifficulty.Beginner];
            Settings.Default.Name1 = BestNames[GameDifficulty.Advanced];
            Settings.Default.Name2 = BestNames[GameDifficulty.Expert];
            Settings.Default.Time0 = BestTimes[GameDifficulty.Beginner];
            Settings.Default.Time1 = BestTimes[GameDifficulty.Advanced];
            Settings.Default.Time2 = BestTimes[GameDifficulty.Expert];
            Settings.Default.MarkQuestion = ctrlGameBoard.Board.MarkQuestion;
            Settings.Default.Difficulty = ctrlGameBoard.Board.Difficulty;
            if (ctrlGameBoard.Board.Difficulty == GameDifficulty.Custom)
            {
                Settings.Default.Rows = ctrlGameBoard.Board.Rows;
                Settings.Default.Columns = ctrlGameBoard.Board.Columns;
                Settings.Default.Mines = ctrlGameBoard.Board.NumMines;
            }
            Settings.Default.Save();
        }
private void SaveSettings ( ) { Settings . Default . Name0 = BestNames [ GameDifficulty . Beginner ] ; Settings . Default . Name1 = BestNames [ GameDifficulty . Advanced ] ; Settings . Default . Name2 = BestNames [ GameDifficulty . Expert ] ; Settings . Default . Time0 = BestTimes [ GameDifficulty . Beginner ] ; Settings . Default . Time1 = BestTimes [ GameDifficulty . Advanced ] ; Settings . Default . Time2 = BestTimes [ GameDifficulty . Expert ] ; Settings . Default . MarkQuestion = ctrlGameBoard . Board . MarkQuestion ; Settings . Default . Difficulty = ctrlGameBoard . Board . Difficulty ; if ( ctrlGameBoard . Board . Difficulty == GameDifficulty . Custom ) { Settings . Default . Rows = ctrlGameBoard . Board . Rows ; Settings . Default . Columns = ctrlGameBoard . Board . Columns ; Settings . Default . Mines = ctrlGameBoard . Board . NumMines ; } Settings . Default . Save ( ) ; }
Store application settings to user data
Store application settings to user data