Ejemplo n.º 1
0
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            // save game state
            PuzzleState gameState = this.game.GetState();

            IsolatedStorageHelper.SaveObject("PuzzleState", gameState);
        }
Ejemplo n.º 2
0
        private void LoadButton_Click(object sender, RoutedEventArgs e)
        {
            var gameState = IsolatedStorageHelper.GetObject <PuzzleState>("PuzzleState");

            if (gameState == null)
            {
                MessageBox.Show("Sorry, no game state found.", "Oops!", MessageBoxButton.OK);
            }
            else
            {
                // set game state
                this.game.SetState(gameState);
            }
        }
Ejemplo n.º 3
0
 private void ClearStorageButton_Click(object sender, RoutedEventArgs e)
 {
     // remove state and image
     IsolatedStorageHelper.DeleteObject("PuzzleState");
 }