예제 #1
0
        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);                                   // Если новостная лента пустая
        }
예제 #2
0
        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);
        }