Ejemplo n.º 1
0
        void ContentServicePublished(Umbraco.Core.Publishing.IPublishingStrategy sender, Umbraco.Core.Events.PublishEventArgs <IContent> e)
        {
            // when something is published, (if it's a ForumPost)
            // clear the relevant forum cache.
            // we do it in two steps because more than one post in a forum
            // may have been published, so we only need to clear the cache
            // once.

            List <string> invalidCacheList = new List <string>();

            foreach (var item in e.PublishedEntities)
            {
                // is a forum post...
                if (item.ContentTypeId == postContentTypeId)
                {
                    // get parent Forum.
                    invalidCacheList = AddParentForumCaches(item, invalidCacheList);
                }
            }

            // clear the cache for any forums that have had child pages published...
            foreach (var cache in invalidCacheList)
            {
                LogHelper.Info <SimpilyForumCacheHandler>("Clearing Forum Info Cache: {0}", () => cache);
                ApplicationContext.Current.ApplicationCache.RuntimeCache.ClearCacheByKeySearch(cache);
            }
        }
        private void ContentService_Published(Umbraco.Core.Publishing.IPublishingStrategy sender, Umbraco.Core.Events.PublishEventArgs <IContent> e)
        {
            //Bruges til at udføre custom-handlinger når et dokument er udgivet

            Startup.ContentChangesGuid = Guid.NewGuid();    //clear localstorage on change
        }