Esempio n. 1
0
        public NewsFeed GetComments(GetCommentsParams @params)
        {
            var parameters = new VkParameters
            {
                { "count", @params.Count },
                { "filters", @params.Filters },
                { "reposts", @params.Reposts },
                { "start_time", @params.StartTime },
                { "end_time", @params.EndTime },
                { "last_comments_count", @params.LastCommentsCount },
                { "start_from", @params.StartFrom },
                { "fields", @params.Fields }
            };
            var response = _vk.Call("newsfeed.getComments", parameters);
            var result   = new NewsFeed
            {
                Items     = response["items"].ToReadOnlyCollectionOf <NewsItem>(x => x),
                Profiles  = response["profiles"].ToReadOnlyCollectionOf <User>(x => x),
                Groups    = response["groups"].ToReadOnlyCollectionOf <Group>(x => x),
                NewOffset = response["new_offset"],
                NextFrom  = response["next_from"]
            };

            return(result);
        }
Esempio n. 2
0
 /// <inheritdoc />
 public VkCollection <Comment> GetComments(GetCommentsParams getCommentsParams)
 {
     return(_vk.Call <VkCollection <Comment> >("widgets.getComments"
                                               , getCommentsParams
                                               , false
                                               , new VkCollectionJsonConverter(collectionField: "posts")));
 }
Esempio n. 3
0
 /// <inheritdoc />
 public Task <VkCollection <Comment> > GetCommentsAsync(GetCommentsParams getComments)
 {
     return(TypeHelper.TryInvokeMethodAsync(func: () => GetComments(getCommentsParams: getComments)));
 }
Esempio n. 4
0
 /// <inheritdoc />
 public async Task <VkCollection <Comment> > GetCommentsAsync(GetCommentsParams getComments)
 {
     return(await TypeHelper.TryInvokeMethodAsync(func : () => _vk.Widgets.GetComments(getCommentsParams: getComments)));
 }
Esempio n. 5
0
 public NewsFeed GetComments(GetCommentsParams @params)
 {
     var parameters = new VkParameters
     {
         { "count", @params.Count },
         { "filters", @params.Filters },
         { "reposts", @params.Reposts },
         { "start_time", @params.StartTime },
         { "end_time", @params.EndTime },
         { "last_comments_count", @params.LastCommentsCount },
         { "start_from", @params.StartFrom },
         { "fields", @params.Fields }
     };
     var response = _vk.Call("newsfeed.getComments", parameters);
     var result = new NewsFeed
     {
         Items = response["items"].ToReadOnlyCollectionOf<NewsItem>(x => x),
         Profiles = response["profiles"].ToReadOnlyCollectionOf<User>(x => x),
         Groups = response["groups"].ToReadOnlyCollectionOf<Group>(x => x),
         NewOffset = response["new_offset"],
         NextFrom = response["next_from"]
     };
     return result;
 }