public PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType, PropertyCacheValue cacheValue) { PropertyCacheLevel returnLevel; switch (cacheValue) { case PropertyCacheValue.Object: returnLevel = PropertyCacheLevel.ContentCache; break; case PropertyCacheValue.Source: returnLevel = PropertyCacheLevel.Content; break; case PropertyCacheValue.XPath: returnLevel = PropertyCacheLevel.Content; break; default: returnLevel = PropertyCacheLevel.None; break; } return(returnLevel); }
static PropertyCacheLevel GetCacheLevel(IPropertyValueConverter converter, PropertyCacheValue value) { if (converter == null) { return(PropertyCacheLevel.Request); } var attr = converter.GetType().GetCustomAttributes <PropertyValueCacheAttribute>(false) .FirstOrDefault(x => x.Value == value || x.Value == PropertyCacheValue.All); return(attr == null ? PropertyCacheLevel.Request : attr.Level); }
public PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType, PropertyCacheValue cacheValue) { PropertyCacheLevel propertyCacheLevel; switch (cacheValue) { case PropertyCacheValue.Source: propertyCacheLevel = PropertyCacheLevel.Content; break; case PropertyCacheValue.Object: propertyCacheLevel = PropertyCacheLevel.ContentCache; break; case PropertyCacheValue.XPath: propertyCacheLevel = PropertyCacheLevel.Content; break; default: propertyCacheLevel = PropertyCacheLevel.None; break; } return propertyCacheLevel; }
public PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType, PropertyCacheValue cacheValue) { PropertyCacheLevel returnLevel; var wrappedPropertyType = GetWrappedPropertyType(propertyType); if (wrappedPropertyType != null) { switch (cacheValue) { case PropertyCacheValue.Object: returnLevel = wrappedPropertyType.ObjectCacheLevel; break; case PropertyCacheValue.Source: returnLevel = wrappedPropertyType.SourceCacheLevel; break; case PropertyCacheValue.XPath: returnLevel = wrappedPropertyType.XPathCacheLevel; break; case PropertyCacheValue.All: returnLevel = PropertyCacheLevel.None; break; default: returnLevel = PropertyCacheLevel.None; break; } } else { returnLevel = PropertyCacheLevel.None; } return(returnLevel); }
/// <summary> /// The get property cache level. /// </summary> /// <param name="propertyType"> /// The property type. /// </param> /// <param name="cacheValue"> /// The cache value. /// </param> /// <returns> /// The <see cref="PropertyCacheLevel"/>. /// </returns> public PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType, PropertyCacheValue cacheValue) { PropertyCacheLevel returnLevel; switch (cacheValue) { case PropertyCacheValue.Object: returnLevel = true ? PropertyCacheLevel.ContentCache : PropertyCacheLevel.Request; break; case PropertyCacheValue.Source: returnLevel = PropertyCacheLevel.Content; break; case PropertyCacheValue.XPath: returnLevel = PropertyCacheLevel.Content; break; default: returnLevel = PropertyCacheLevel.None; break; } return returnLevel; }
public PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType, PropertyCacheValue cacheValue) { switch (cacheValue) { case PropertyCacheValue.Source: return(PropertyCacheLevel.Content); case PropertyCacheValue.Object: case PropertyCacheValue.XPath: return(PropertyCacheLevel.ContentCache); } return(PropertyCacheLevel.None); }
public PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType, PropertyCacheValue cacheValue) { return(PropertyCacheLevel.Content); }
public PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType, PropertyCacheValue cacheValue) { return PropertyCacheLevel.Content; }
public new PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType, PropertyCacheValue cacheValue) { return(BaseValueConverter.GetPropertyCacheLevel(propertyType, cacheValue)); }
/// <summary> /// Initializes a new instance of the <see cref="PropertyValueCacheAttribute"/> class with a cacheable value and a cache level. /// </summary> /// <param name="value">The cacheable value.</param> /// <param name="level">The cache level.</param> public PropertyValueCacheAttribute(PropertyCacheValue value, PropertyCacheLevel level) { Value = value; Level = level; }
static PropertyCacheLevel GetCacheLevel(IPropertyValueConverter converter, PropertyCacheValue value) { if (converter == null) return PropertyCacheLevel.Request; var attr = converter.GetType().GetCustomAttributes<PropertyValueCacheAttribute>(false) .FirstOrDefault(x => x.Value == value || x.Value == PropertyCacheValue.All); return attr == null ? PropertyCacheLevel.Request : attr.Level; }