private void UpdatePostDataBySelectedPost(PostDataHolder i_SelectedPostData)
 {
     updatedLikeNumberBySelectedPost(i_SelectedPostData.LikesNumber);
     updatedPictureOfSelectedPost(i_SelectedPostData.PostUrl);
     updatedCommentsOfSelectedPost(i_SelectedPostData.Commnets);
     m_NameOfWhoLikedSelectedPost = i_SelectedPostData.WhoLikedNamesList;
 }
Exemplo n.º 2
0
        public List <PostDataHolder> GetPostsData(int i_StarIndex)
        {
            try
            {
                const int                       k_NumberOfPostToReturn = 10;
                List <PostDataHolder>           postDataList           = new List <PostDataHolder>();
                FacebookObjectCollection <Post> myPosts = FacebookUser.Posts;
                for (int i = i_StarIndex; i < i_StarIndex + k_NumberOfPostToReturn; i++)
                {
                    int            likesNumber      = myPosts[i].LikedBy.Count;
                    List <string>  comments         = getCommentsMessages(myPosts[i].Comments);
                    List <string>  whoLikedThisPost = getListOfPeopleWhoLikedThisPost(myPosts[i].LikedBy);
                    PostDataHolder post;
                    post = new PostDataHolder(myPosts[i].Message, myPosts[i].PictureURL, likesNumber, comments, whoLikedThisPost);
                    postDataList.Add(post);
                }

                m_LastPostIndex = i_StarIndex + k_NumberOfPostToReturn;
                return(postDataList);
            }
            catch (IndexOutOfRangeException ex)
            {
                throw new ApplicationException("You dont have more Posts");
            }
        }
        private void listBoxWall_SelectedIndexChanged(object sender, EventArgs e)
        {
            object         selectedPost     = listBoxWall.SelectedItem;
            PostDataHolder selectedPostData = selectedPost as PostDataHolder;

            listBoxSearchResults.Items.Clear();
            UpdatePostDataBySelectedPost(selectedPostData);
        }