示例#1
0
        protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
        {
            using (ApplicationContext.Current.ProfilingLogger.TraceDuration <Startup>("Begin ApplicationStarted", "End ApplicationStarted"))
            {
                base.ApplicationStarted(umbracoApplication, applicationContext);

                this.SetupMigration();

                Mapper.AddProfile <RuleProfile>();

                EditorModelEventManager.SendingContentModel += EditorModelEventManagerEventHandler.SendingContentModel;

                CacheRefresherBase <RuleCacheRefresher> .CacheUpdated += this.CacheUpdated;

                ServerVariablesParser.Parsing += this.ServerVariablesParserParsing;
            }

            if (HidePropertiesContext.Current.Configuration.EnableImport && HidePropertiesContext.Current.Configuration.ImportAtStartup)
            {
                using (ApplicationContext.Current.ProfilingLogger.TraceDuration <Startup>("Begin import rules", "End import rules"))
                {
                    HidePropertiesContext.Current.ImportRules();

                    RuleCacheRefresher.ClearCache();
                }
            }
        }
示例#2
0
        public HttpResponseMessage Import()
        {
            HidePropertiesContext.Current.ImportRules();

            RuleCacheRefresher.ClearCache();

            return(this.Request.CreateResponse(HttpStatusCode.OK));
        }
示例#3
0
        private Rule UpdateRule(Rule rule)
        {
            rule = RuleService.Current.Save(rule);

            if (rule != null)
            {
                RuleCacheRefresher.ClearCache();

                if (HidePropertiesContext.Current.Configuration.EnableExport && HidePropertiesContext.Current.Configuration.ExportOnSave)
                {
                    HidePropertiesContext.Current.ExportRules();
                }
            }

            return(rule);
        }
示例#4
0
 private void CacheUpdated(RuleCacheRefresher sender, CacheRefresherEventArgs e)
 {
     // clear rule cache, this will executed on all servers
     ApplicationContext.Current.ApplicationCache.RuntimeCache.ClearCacheByKeySearch(RuntimeCacheConstants.RuntimeCacheKeyPrefix);
 }