Example #1
0
        /// <summary>
        /// Edit comment.
        /// </summary>
        /// <param name="comment"></param>
        /// <returns></returns>
        public bool EditComment(string comment_id, CommentStatus status, DateTime date_created_gmt, string content, string author, string author_url, string author_email)
        {
            var xmlRpcComment = new XmlRpcComment
            {
                author       = author,
                author_email = author_email,
                author_url   = author_url,
                dateCreated  = date_created_gmt,
                content      = content,
                status       = EnumsHelper.GetCommentStatusName(status)
            };

            return(_wrapper.EditComment(this.BlogID, Username, Password, xmlRpcComment));
        }
Example #2
0
            internal static Comment Comment(XmlRpcComment input)
            {
                var result = new Comment(input.post_id)
                {
                    AuthorEmail = input.author_email,
                    AuthorName  = input.author,
                    AuthorUrl   = input.author_url,
                    Content     = input.content,
                };

                MapUtility.SetPrivateFieldValue <Comment>("CommentParentID", input.comment_parent, result);

                return(result);
            }
Example #3
0
        /// <summary>
        /// Create new comment.
        /// </summary>
        /// <param name="postid"></param>
        /// <param name="comment"></param>
        /// <returns></returns>
        public string NewComment(int postid, int?comment_parent, string content, string author, string author_url, string author_email)
        {
            var xmlRpcComment = new XmlRpcComment
            {
                parent       = Convert.ToString(comment_parent),
                content      = content,
                author       = author,
                author_url   = author_url,
                author_email = author_email
            };

            var result = _wrapper.NewComment(this.BlogID, Username, Password, Convert.ToString(postid), xmlRpcComment);

            return(Convert.ToString(result));
        }
Example #4
0
            internal static Comment Comment(XmlRpcComment input)
            {
                ConstructorInfo ctor = typeof(Comment).GetConstructors
                                           (BindingFlags.Instance | BindingFlags.Public)[0];

                var result = (Comment)ctor.Invoke(new object[] { });

                result.AuthorEmail = input.author_email;
                result.AuthorIP    = input.author_ip;
                result.AuthorName  = input.author;
                result.AuthorUrl   = input.author_url;
                result.CommentID   = Convert.ToInt16(input.comment_id);
                result.Content     = input.content;
                result.DateCreated = input.date_created_gmt;  //input.dateCreated;
                result.Link        = input.link;
                result.PostID      = Convert.ToInt16(input.post_id);
                result.PostTitle   = input.post_title;
                result.UserID      = Convert.ToInt16(input.user_id);
                result.Status      = EnumsHelper.GetCommentStatus(input.status);

                return(result);
            }
        /// <summary>
        /// Create new comment.
        /// </summary>
        /// <param name="postid"></param>
        /// <param name="comment"></param>
        /// <returns></returns>
        public string NewComment(int postid, int? comment_parent, string content, string author, string author_url, string author_email)
        {
            var xmlRpcComment = new XmlRpcComment
            {
                parent = Convert.ToString(comment_parent),
                content = content,
                author = author,
                author_url = author_url,
                author_email = author_email
            };

            var result = _wrapper.NewComment(this.BlogID, Username, Password, Convert.ToString(postid), xmlRpcComment);
            return Convert.ToString(result);
        }
        /// <summary>
        /// Edit comment.
        /// </summary>
        /// <param name="comment"></param>
        /// <returns></returns>
        public bool EditComment(string comment_id, CommentStatus status, DateTime date_created_gmt, string content, string author, string author_url, string author_email)
        {
            var xmlRpcComment = new XmlRpcComment
            {

                author = author,
                author_email = author_email,
                author_url = author_url,
                dateCreated = date_created_gmt,
                content = content,
                status = EnumsHelper.GetCommentStatusName(status)
            };

            return _wrapper.EditComment(this.BlogID, Username, Password, xmlRpcComment);
        }
Example #7
0
            internal static Comment Comment(XmlRpcComment input)
            {
                var result = new Comment(input.post_id)
                {
                    AuthorEmail = input.author_email,
                    AuthorName = input.author,
                    AuthorUrl = input.author_url,
                    Content = input.content,
                };

                MapUtility.SetPrivateFieldValue<Comment>("CommentParentID", input.comment_parent, result);

                return result;
            }