コード例 #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));
        }
コード例 #2
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));
        }
コード例 #3
0
ファイル: Mapper.cs プロジェクト: PagesWriter/PagesWriter
            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.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);
            }