public bool GetNews(VkUser user) { if (user.FriendsList != null) { PostList = new List <VkPost>(); foreach (VkUser friend in user.FriendsList) { VkWall friendWall = new VkWall(); if (friendWall.GetUserWall(user)) // Если стена есть { foreach (VkPost post in friendWall.PostList) { PostList.Add(post); } } } if (PostList.Count() > 0) { return(true); // Если новостная лента НЕ пустая } } return(false); // Если новостная лента пустая }
public Dictionary <int, VkWall> GetWallsForFriendsInUserGraph(List <VkUser> listGroupMembers) { var userWallDictionary = new Dictionary <int, VkWall>(); foreach (var groupMember in listGroupMembers) { foreach (var friend in groupMember.FriendsList) { var friendWall = new VkWall(); if (!userWallDictionary.ContainsKey(friend.Id) && friendWall.GetTopPosts(friend, 10)) { userWallDictionary.Add(friend.Id, friendWall); } } } return(userWallDictionary); }