Example #1
0
        protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
        {
            _logger = applicationContext.ProfilingLogger.Logger;
            Aubergine.LoadSettingsNode(false);

            ContentService.Published += ContentService_Published;

            var contentType =
                applicationContext.Services.ContentTypeService.GetContentType("siteSettings");

            if (contentType != null)
            {
                settingsContentTypeId = contentType.Id;
            }
        }
Example #2
0
 private void ContentService_Published(Umbraco.Core.Publishing.IPublishingStrategy sender, Umbraco.Core.Events.PublishEventArgs <IContent> e)
 {
     try
     {
         if (settingsContentTypeId != -1)
         {
             foreach (var item in e.PublishedEntities)
             {
                 if (item.ContentTypeId == settingsContentTypeId)
                 {
                     Aubergine.LoadSettingsNode();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         _logger.Warn <SiteSettingEventHandler>("Failed to re-load settings: {0}", () => ex.ToString());
     }
 }