private void Log_ContentPublished(global::Umbraco.Core.Publishing.IPublishingStrategy sender, global::Umbraco.Core.Events.PublishEventArgs <global::Umbraco.Core.Models.IContent> e)
 {
     foreach (var entity in e.PublishedEntities)
     {
         LogAction(entity, "published");
     }
 }
Пример #2
0
 private void ContentService_Published(global::Umbraco.Core.Publishing.IPublishingStrategy sender, global::Umbraco.Core.Events.PublishEventArgs <global::Umbraco.Core.Models.IContent> e)
 {
     // if any rules or config were published,show the reminder message to refresh the display
     if (e.PublishedEntities.Any(x => x.ContentType.Alias.StartsWith("keepOutSecurityRule")))
     {
         RefreshRules();  // ensure rules are updated on the fly
         RefreshConfig(); // likewise the config
         e.Messages.Add(new EventMessage("KeepOut Security", "KeepOut Security updated. Refresh the node tree to reflect changes", EventMessageType.Warning));
     }
 }
        /// <summary>
        /// Delete HTML on unpublish
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void ContentServiceUnPublished(global::Umbraco.Core.Publishing.IPublishingStrategy sender, global::Umbraco.Core.Events.PublishEventArgs <IContent> e)
        {
            if (!CheckConfig())
            {
                return;
            }

            foreach (var content in e.PublishedEntities.Where(Content => Content.Id > 0))
            {
                HtmlCache.Remove(content.Id);
            }
        }
 internal static void Save(global::Umbraco.Core.Publishing.IPublishingStrategy sender, PublishEventArgs <IContent> e)
 {
     e.PublishedEntities.ForEach(AddOrSave);
 }
 /// <summary>
 /// Republishing all nodes tends to throw timeouts if you have enough of them. This
 /// should prevent that without modifying the default for the whole site...
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void ContentService_Publishing(global::Umbraco.Core.Publishing.IPublishingStrategy sender, global::Umbraco.Core.Events.PublishEventArgs <IContent> e)
 {
     Library.SetTimeout(Config.Instance.GetByKey("ScriptTimeout"));
 }