コード例 #1
0
        internal CacheMode GetCacheMode(RenderingBlock block, IPublishedContent content, ViewDataDictionary viewData)
        {
            var modeFunc = ModeFunc;

            if (!string.IsNullOrWhiteSpace(Mode) && !CacheMode.TryGetValue(Mode, out modeFunc))
            {
                return(Blocks.CacheMode.Ignore);
            }
            return(modeFunc == null ? Blocks.CacheMode.Ignore : modeFunc(block, content, viewData));
        }
コード例 #2
0
        internal string GetCacheCustom(HttpRequestBase request, RenderingBlock block, IPublishedContent content, ViewDataDictionary viewData)
        {
            var customFunc = CustomFunc;

            if (!string.IsNullOrWhiteSpace(ByCustom) && !CacheCustom.TryGetValue(ByCustom, out customFunc))
            {
                return(null);
            }
            return(customFunc == null ? null : customFunc(request, block, content, viewData));
        }