private void listBoxOrderMethod_SelectedIndexChanged(object sender, EventArgs e) { IStrategy selectedStrategy = listBoxOrderMethod.SelectedItem as IStrategy; List <User> userFriends = FacebookUtilities.getOrderedFriendsList(selectedStrategy); PopulateFriendsList(userFriends); }
private void LogOut() { FacebookUtilities.LogOut(); lblConnect.Text = string.Format("Disconnected"); lblConnect.ForeColor = Color.Red; lblConnect.Location = new Point(lblConnect.Location.X + 95, lblConnect.Location.Y); pictureBoxProfile.Image = null; tabObserveFriendsBio.Enabled = false; labelPleaseLogin.Show(); btnLogin.Show(); buttonLogOut.Hide(); checkBoxPrimaryApp.Show(); tabObserveFriendsBio.SelectedIndex = 0; }
private void fetchLikeStats() { Dictionary <string, int> dicLikeStats = FacebookUtilities.GetLikeStatistics(); var sortedDict = from entry in dicLikeStats orderby entry.Value descending select entry; foreach (KeyValuePair <string, int> friend in sortedDict) { listBoxMostLikesFriends.Invoke(new Action(() => listBoxMostLikesFriends.Items.Add(friend.Key + string.Format(" likes count:({0})", friend.Value)))); } if (dicLikeStats.Count == 0) { MessageBox.Show("No Friends to retrieve :("); } }
/// <summary> /// Start a new game /// </summary> /// <returns>whether the game was started succesfully</returns> public bool StartNewGame() { this.m_nLevel = 1; this.m_score = 0; this.m_nUsedClues = 0; this.m_nCorrectAnswers = 0; this.m_usedClue = false; m_freindsList = FacebookUtilities.GetTenRandomFriends(); if (m_freindsList != null) { m_currentFriend = this.m_freindsList.ElementAt(0); return(true); } else { return(false); } }
private void btnLogin_Click(object sender, EventArgs e) { try { User loggedInUser = FacebookUtilities.LoginToFacebookApp(!checkBoxPrimaryApp.Checked); if (loggedInUser != null) { fetchUserInfo(); } else { MessageBox.Show("Couldn't Loggin"); } } catch { MessageBox.Show("Something wen't wrong in connection please try again later"); } }