コード例 #1
0
 private void Commentable_published(IPublishingStrategy sender, PublishEventArgs<IContent> e)
 {
     foreach (IContent node in e.PublishedEntities)
       {
     if (node.ContentType.AllowedContentTypes.Where(x => x.Alias == "Commenttree").Any())
     {
       IContentService cs = new ContentService();
       IContent comment_tree = node.Children().Where(x => x.ContentType.Alias == "Commenttree").First();
       if (comment_tree != null)
     cs.SaveAndPublishWithStatus(comment_tree);
     }
       }
 }