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)); }