private void initFriendList(List <Friend> io_Friends) { foreach (User friendOfUser in r_AppManager.FetchFriendsUserCollection()) { io_Friends.Add(new Friend(friendOfUser)); } }
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."); } }
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); }
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."); } }
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."); } }
public FacebookObjectCollection <User> FetchFriendsList() { return(r_AppManager.FetchFriendsUserCollection()); }