Example #1
0
        public List <UserRating> BestFriendsAlgorithm(FacebookFacade i_Facade)
        {
            Dictionary <string, UserRating> friendsRatingDictionary = initializeUserRatingDictionary(i_Facade);

            calculateFriendsRatingAndUpdate(friendsRatingDictionary, i_Facade);
            List <UserRating> usersRatingSortedList = convertDictionaryToList(friendsRatingDictionary);

            usersRatingSortedList.Sort((t1, t2) => t1.Rating.CompareTo(t2.Rating));
            usersRatingSortedList.Reverse();

            return(usersRatingSortedList);
        }
Example #2
0
        private Dictionary <string, UserRating> initializeUserRatingDictionary(FacebookFacade i_Facade)
        {
            Dictionary <string, UserRating> o_InitializedUserRatingDictionary = new Dictionary <string, UserRating>();
            FacebookObjectCollection <User> userFriends = i_Facade.GetFriends();

            foreach (User user in userFriends)
            {
                o_InitializedUserRatingDictionary.Add(user.Id, new UserRating(user));
            }

            return(o_InitializedUserRatingDictionary);
        }
Example #3
0
 public FacebookForm()
 {
     try
     {
         m_Facade = new FacebookFacade();
         InitializeComponent();
         this.RememberMeCheckbox.Checked = m_Facade.IsRememberMeChecked();
     }
     catch
     {
         MessageBox.Show("There was a problem initializing the application.", "Initializing Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #4
0
 private void updateFriendsRatingUsingComments(Dictionary <string, UserRating> io_FriendsRatingDictionary, FacebookFacade i_Facade)
 {
     updateUserRatingCommentsOnPosts(io_FriendsRatingDictionary, i_Facade.GetWallPosts(), i_Facade.GetID());
     updateUserRatingCommentsOnPosts(io_FriendsRatingDictionary, i_Facade.GetPosts(), i_Facade.GetID());
 }
Example #5
0
 private void calculateFriendsRatingAndUpdate(Dictionary <string, UserRating> i_FriendsRatingDictionary, FacebookFacade i_Facade)
 {
     updateFriendsRatingUsingLikes(i_FriendsRatingDictionary, i_Facade);
     updateFriendsRatingUsingComments(i_FriendsRatingDictionary, i_Facade);
 }