private async void InsertGetGame() { try { Game game = new Game(); game.CurrentGame = DateTime.Now.ToString(); game.Solution = DateTime.Now.ToString(); game.HashedGame = DateTime.Now.ToString().GetHashCode().ToString(); var res = AzureTableHelper.Insert(game).Result; await Task.Delay(TimeSpan.FromSeconds(45)); var res2 = AzureTableHelper.GetGame(game).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(); } }