Exemplo n.º 1
0
        private IPageOfItems <PostComment> processDisplayOfComments(Func <IPageOfItems <PostComment> > getComments)
        {
            IPageOfItems <PostComment> comments    = getComments();
            List <PostComment>         newComments = new List <PostComment>();

            foreach (PostComment comment in comments)
            {
                CommentOut commentProxy = new CommentOut(comment, absolutePathHelper.GetAbsolutePath(comment));

                pluginEngine.ExecuteAll("ProcessDisplayOfComment", new { context, post = new PostSmallReadOnly(comment.Post), comment = commentProxy });

                newComments.Add(commentProxy.ToPostComment(comment.Parent));
            }

            return(new PageOfItems <PostComment>(newComments, comments.PageIndex, comments.PageSize, comments.TotalItemCount));
        }
 public static PostComment ToPostComment(this CommentOut comment, PostCommentSmall parent, PostSmall post)
 {
     return(new PostComment(comment.Body, comment.Created, comment.CreatorUserID, comment.CreatorName, comment.CreatorEmail, comment.CreatorEmailHash, comment.CreatorUrl, comment.CreatorIP, comment.CreatorUserAgent, comment.Language, comment.Modified, parent, post, comment.Url, comment.State));
 }