Exemplo n.º 1
0
        private void listBoxOrderMethod_SelectedIndexChanged(object sender, EventArgs e)
        {
            IStrategy   selectedStrategy = listBoxOrderMethod.SelectedItem as IStrategy;
            List <User> userFriends      = FacebookUtilities.getOrderedFriendsList(selectedStrategy);

            PopulateFriendsList(userFriends);
        }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
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 :(");
            }
        }
Exemplo n.º 4
0
        /// <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);
            }
        }
Exemplo n.º 5
0
        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");
            }
        }