Beispiel #1
0
        /// <summary>
        /// Get widget information
        /// </summary>
        /// <param name="widgetPath">Widget path</param>
        /// <returns></returns>
        public virtual TemplateWidgetInfo GetWidgetInfo(string widgetPath)
        {
            var info = WidgetInfoCache.GetOrDefault(widgetPath);

            if (info == null)
            {
                info = TemplateWidgetInfo.FromPath(widgetPath);
                WidgetInfoCache.Put(widgetPath, info, WidgetInfoCacheTime);
            }
            return(info);
        }
Beispiel #2
0
        /// <summary>
        /// Get cache isolation policy names
        /// With "Device" anyway even it's not in the configuration
        /// </summary>
        /// <param name="info">Widget information</param>
        /// <returns></returns>
        public static IList <string> GetCacheIsolationPolicyNames(this TemplateWidgetInfo info)
        {
            var result = new List <string>();

            if (!string.IsNullOrEmpty(info.CacheBy))
            {
                result.AddRange(info.CacheBy.Split(','));
            }
            result.Add("Device");
            return(result);
        }