private void GetTopNRankersFacebookFriendsCallback(object response, bool IsException) { if (IsException) { App42Exception exception = (App42Exception)response; //showMessage("Exception,Please try again later"); } else { com.shephertz.app42.paas.sdk.windows.game.Game game = (com.shephertz.app42.paas.sdk.windows.game.Game)response; if (game.IsResponseSuccess()) { for (int i = 0; i < game.GetScoreList().Count; i++) { ScoreListItem item = new ScoreListItem(); item.Rank = (i + 1).ToString(); item.Score = game.GetScoreList()[i].GetValue().ToString(); item.UserId = game.GetScoreList()[i].GetFacebookProfile().GetId(); item.UserName = game.GetScoreList()[i].GetFacebookProfile().GetName(); _friendscorelist.Add(item); } lbxFriendsScore.ItemsSource = _friendscorelist; if (_friendscorelist.Count == 0) { lbxFriendsScoremessageTB.Text = "There is no item in list"; } else { IsLoaded_friendscorelist = true; lbxFriendsScoreMessagePopup.Visibility = Visibility.Collapsed; } } else { lbxFriendsScoremessageTB.Text = "Error,Please try again later"; // showMessage("Error,Please try again later"); } } }
private void GetTopNRankersCallback(object response, bool IsException) { if (IsException) { App42Exception exception = (App42Exception)response; //showMessage("Exception,Please try again later"); } else { List<string> userIds = new List<string>(); com.shephertz.app42.paas.sdk.windows.game.Game game = (com.shephertz.app42.paas.sdk.windows.game.Game)response; if (game.IsResponseSuccess()) { for (int i = 0; i < game.GetScoreList().Count; i++) { ScoreListItem item = new ScoreListItem(); item.Rank = (i + 1).ToString(); item.Score = game.GetScoreList()[i].GetValue().ToString(); item.UserName = game.GetScoreList()[i].GetUserName(); _scorelist.Add(item); userIds.Add(game.GetScoreList()[i].GetUserName()); } App42Api.GetFacebookProfilesFromIds(userIds, GetUserFacebookProfileFromIdsCallback); } else { lbxGlobalScoremessageTB.Text = "Error,Please try again later"; } } }