/// <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); }
/// <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; }
public ReadOnlyCollection<Comment> GetComments(out int totalCount, WallGetCommentsParams @params) { var response = GetComments(@params); totalCount = Convert.ToInt32(response.TotalCount); return response.ToReadOnlyCollection(); }
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); }