private async void GetUpdatePlayer() { try { Player player = new Player { Username = DateTime.Now.ToString("MMddyyHHmmss"), Password = "******" }; var res = AzureTableHelper.GetPlayer(player).Result; await Task.Delay(TimeSpan.FromSeconds(45)); player.Password = "******"; res = AzureTableHelper.Update(player).Result; await Task.Delay(TimeSpan.FromSeconds(45)); } catch (Exception ex) { Assert.Fail(ex.Message); } }
private async void btnLoad_Click(object sender, RoutedEventArgs e) { Game game = new Game(); Player player = new Player(); player.Username = App.CurrentUser.Username; player.Password = App.CurrentUser.Password; game.HashedGame = AzureTableHelper.GetPlayer(player).Result.SavedGameId; if (!string.IsNullOrEmpty(game.HashedGame)) { Game resGame = AzureTableHelper.GetGame(game).Result; Puzzle saved = new Puzzle(4, 4); saved.PuzzleBoard = (Board)JsonConvert.DeserializeObject <Board>(resGame.CurrentGame); saved.PuzzleSolution = (Solution)JsonConvert.DeserializeObject <Solution>(resGame.Solution); this.Frame.Navigate(typeof(MainPage), saved); } else { var dialog = new MessageDialog("Oops.......No saved game ! ! !"); await dialog.ShowAsync(); } }