Параметры метода wall.getComments
예제 #1
0
        /// <summary>
        /// Привести к типу VkParameters.
        /// </summary>
        /// <param name="p">Параметры.</param>
        /// <returns></returns>
        public static VkParameters ToVkParameters(WallGetCommentsParams p)
        {
            var parameters = new VkParameters
            {
                { "owner_id", p.OwnerId },
                { "post_id", p.PostId },
                { "need_likes", p.NeedLikes },
                { "start_comment_id", p.StartCommentId },
                { "offset", p.Offset },
                { "count", p.Count },
                { "sort", p.Sort },
                { "preview_length", p.PreviewLength },
                { "extended", p.Extended }
            };

            return(parameters);
        }
예제 #2
0
        /// <summary>
        /// Привести к типу VkParameters.
        /// </summary>
        /// <param name="p">Параметры.</param>
        /// <returns></returns>
        internal static VkParameters ToVkParameters(WallGetCommentsParams p)
        {
            var parameters = new VkParameters
            {
                { "owner_id", p.OwnerId },
                { "post_id", p.PostId },
                { "need_likes", p.NeedLikes },
                { "start_comment_id", p.StartCommentId },
                { "offset", p.Offset },
                { "count", p.Count },
                { "sort", p.Sort },
                { "preview_length", p.PreviewLength },
                { "extended", p.Extended }
            };

            return parameters;
        }
예제 #3
0
        public ReadOnlyCollection<Comment> GetComments(out int totalCount, WallGetCommentsParams @params)
        {
            var response = GetComments(@params);

            totalCount = Convert.ToInt32(response.TotalCount);

            return response.ToReadOnlyCollection();
        }
예제 #4
0
        public ReadOnlyCollection<Comment> GetComments(
            long ownerId,
            long postId,
            out int totalCount,
            SortOrderBy? sort = null,
            bool needLikes = false,
            int? count = null,
            int? offset = null,
            int previewLength = 0)
        {
            VkErrors.ThrowIfNumberIsNegative(() => postId);
            VkErrors.ThrowIfNumberIsNegative(() => offset);
            VkErrors.ThrowIfNumberIsNegative(() => count);
            VkErrors.ThrowIfNumberIsNegative(() => previewLength);

            var parameters = new WallGetCommentsParams
            {
                OwnerId = ownerId,
                PostId = postId,
                NeedLikes = needLikes,
                Count = count,
                Offset = offset,
                PreviewLength = previewLength,
                Sort = sort
            };

            return GetComments(out totalCount, parameters);
        }