예제 #1
0
        /// <summary>
        /// Gets a set of comments for a given post. Note that this only works for WordPress version 2.6.1 or higher.
        /// </summary>
        /// <param name="post_id"></param>
        /// <param name="status"></param>
        /// <param name="number"></param>
        /// <param name="offset"></param>
        /// <returns></returns>
        public IEnumerable <Comment> GetComments(int post_id, string status, int number, int offset)
        {
            //var statusList = GetCommentStatusList(post_id);
            //todo: add some validation to make sure supplied status is available.

            var filter = new XmlRpcCommentFilter
            {
                post_id = post_id,
                number  = number,
                offset  = offset,
                status  = status
            };

            var result       = new List <Comment>();
            var xmlRpcResult = _wrapper.GetComments(this.BlogID, Username, Password, filter);

            foreach (var r in xmlRpcResult)
            {
                result.Add(Map.To.Comment(r));
            }

            return(result);
        }
예제 #2
0
        /// <summary>
        /// Gets a set of comments for a given post. Note that this only works for WordPress version 2.6.1 or higher.
        /// </summary>
        /// <param name="post_id"></param>
        /// <param name="status"></param>
        /// <param name="number"></param>
        /// <param name="offset"></param>
        /// <returns></returns>
        public IEnumerable<Comment> GetComments(int post_id, string status, int number, int offset)
        {
            //var statusList = GetCommentStatusList(post_id);
            //todo: add some validation to make sure supplied status is available.

            var filter = new XmlRpcCommentFilter
            {
                post_id = post_id,
                number = number,
                offset = offset,
                status = status
            };

            var result = new List<Comment>();

            var xmlRpcResult = _wrapper.GetComments(this.BlogID, Username, Password, filter);

            foreach (var r in xmlRpcResult)
                result.Add(Map.To.Comment(r));

            return result;
        }