Пример #1
0
        /// <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);
        }