示例#1
0
文件: Post.cs 项目: dgryphon/personal
        /// <summary>
        /// Approves a Comment for publication.
        /// </summary>
        /// <param name="comment">The Comment to approve</param>
        public void ApproveComment(Comment comment)
        {
            CancelEventArgs e = new CancelEventArgs();

            Comment.OnApproving(comment, e);
            if (!e.Cancel)
            {
                int inx = Comments.IndexOf(comment);
                Comments[inx].IsApproved = true;
                this.DateModified        = comment.DateCreated;
                this.DataUpdate();
                Comment.OnApproved(comment);
                SendNotifications(comment);
            }
        }
示例#2
0
        /// <summary>
        /// Approves a Comment for publication.
        /// </summary>
        /// <param name="comment">
        /// The Comment to approve
        /// </param>
        public void ApproveComment(Comment comment)
        {
            var e = new CancelEventArgs();

            Comment.OnApproving(comment, e);
            if (e.Cancel)
            {
                return;
            }

            var inx = this.Comments.IndexOf(comment);

            this.Comments[inx].IsApproved = true;
            this.Comments[inx].IsSpam     = false;
            this.DateModified             = comment.DateCreated;
            this.DataUpdate();
            Comment.OnApproved(comment);
            this.SendNotifications(comment);
        }