Esempio n. 1
0
 private void initFriendList(List <Friend> io_Friends)
 {
     foreach (User friendOfUser in r_AppManager.FetchFriendsUserCollection())
     {
         io_Friends.Add(new Friend(friendOfUser));
     }
 }
Esempio n. 2
0
        public List <string> FetchFriendsByBirthYear(string i_BirthYear)
        {
            List <string> friendListFilter = new List <string>();

            try
            {
                foreach (User friend in r_AppManager.FetchFriendsUserCollection())
                {
                    if (friend.Birthday != null)
                    {
                        string year = friend.Birthday.Substring(6, 4);
                        if (year.Equals(i_BirthYear))
                        {
                            friendListFilter.Add($"{friend.Name}");
                        }
                    }
                }

                return(friendListFilter);
            }
            catch (Exception ex)
            {
                throw new Exception("Fetch friends by birth year failed. Please try again.");
            }
        }
Esempio n. 3
0
        public List <string> FetchBirthdaysFriendListLogic()
        {
            List <string> birthdaysFriends = new List <string>();

            foreach (User friend in r_AppManager.FetchFriendsUserCollection())
            {
                IBirthdayFormat iBirthdayFormat = new BirthdayFormatAdapter(friend);
                if (friend.Birthday != null)
                {
                    birthdaysFriends.AddRange(iBirthdayFormat.CreateFormattedBirthdaysList());
                }
            }

            return(birthdaysFriends);
        }
Esempio n. 4
0
        public List <string> FetchFriendByGenderListLogic(string i_GenderType)
        {
            List <string> friendListFilter = new List <string>();

            try
            {
                foreach (User friend in r_AppManager.FetchFriendsUserCollection())
                {
                    if (friend.Gender != null)
                    {
                        if (friend.Gender.ToString().Equals(i_GenderType.ToLower()))
                        {
                            friendListFilter.Add($"{friend.Name}");
                        }
                    }
                }

                return(friendListFilter);
            }
            catch (Exception ex)
            {
                throw new Exception("Fetch friends by gender failed. Please try again.");
            }
        }
Esempio n. 5
0
        public List <string> FetchFriendByCityListLogic(string i_City)
        {
            List <string> friendListFilter = new List <string>();

            try
            {
                foreach (User friend in r_AppManager.FetchFriendsUserCollection())
                {
                    if (friend.Location.Name != null)
                    {
                        if (friend.Location.Name.ToLower().Contains(i_City.ToLower()))
                        {
                            friendListFilter.Add($"{friend.Name}");
                        }
                    }
                }

                return(friendListFilter);
            }
            catch (Exception ex)
            {
                throw new Exception("Fetch friends by city failed. Please try again.");
            }
        }
Esempio n. 6
0
 public FacebookObjectCollection <User> FetchFriendsList()
 {
     return(r_AppManager.FetchFriendsUserCollection());
 }