Example #1
0
        private void updateListBoxByLikes(FacebookObjectCollection <Post> i_PostsToFilter, int i_LikesThreshold)
        {
            FacebookObjectCollection <Post> filteredPosts;

            clearCollectionsItemsTabControlListBoxes();
            filteredPosts = FacebookLogic.FilterPostsByLikesCount(i_PostsToFilter, i_LikesThreshold);
            addItemsToPostListBox <Post>(filteredPosts);
        }
Example #2
0
        private void updateListBoxByDate(FacebookObjectCollection <Post> i_PostsToFilter, DateTime i_SelectedDate)
        {
            FacebookObjectCollection <Post> filteredPosts;

            clearCollectionsItemsTabControlListBoxes();
            filteredPosts = FacebookLogic.FilterPostsByDate(i_PostsToFilter, i_SelectedDate);
            addItemsToPostListBox <Post>(filteredPosts);
        }
Example #3
0
 private void postsListBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         m_SelectedItem = FacebookLogic.ConvertItemToSelectedItem((PostedItem)postsListBox.SelectedItem);
         new Thread(bindSelectedItem).Start();
     }
     catch (Exception ex)
     {
         MessageBox.Show("A problem occured while trying to display the post.");
     }
 }
Example #4
0
        private void logInUser()
        {
            string loginError = string.Empty;

            try
            {
                loginError = FacebookLogic.LogInUser();
            }
            catch (Exception e)
            {
                MessageBox.Show("Could not log in to the facebook server.");
            }

            InitiateFormInfo(loginError);
            new Thread(fetchUserInfo).Start();
        }
Example #5
0
 private void updateLikeButtonName()
 {
     try
     {
         if (FacebookLogic.IsSelectedItemLikedByUser(m_SelectedItem))
         {
             likeButton.Text = "Dislike";
         }
         else
         {
             likeButton.Text = "Like";
         }
     }
     catch (Exception e)
     {
         MessageBox.Show("There was a problem determining user post like.");
     }
 }
Example #6
0
 private void likeButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (m_SelectedItem != null)
         {
             if (FacebookLogic.IsSelectedItemLikedByUser(m_SelectedItem))
             {
                 m_SelectedItem.DislikePost();
             }
             else
             {
                 m_SelectedItem.LikePost();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("There was a problem liking the post.");
     }
 }
Example #7
0
 private void logOutUser()
 {
     FacebookLogic.LogOutUser();
     clearAllData();
     connectionButton.Text = "Log In";
 }
Example #8
0
 private void dateFilterComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     FacebookLogic.setDateFilterComparison(dateFilterComboBox.SelectedItem as string);
 }