Class ViewContextExtensions
Inheritance
Inherited Members
Namespace: ImageVault.EPiServer
Assembly: ImageVault.EPiServer.dll
Syntax
public static class ViewContextExtensions
Methods
GetImageVaultPropertyCacheKey(ViewContext, Type)
Gets a cache key based on the current property
Declaration
public static string GetImageVaultPropertyCacheKey(this ViewContext ctx, Type instanceType = null)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Mvc.ViewContext | ctx | |
System.Type | instanceType | The type of data that the cache should be storing. If MediaItem, this can be null |
Returns
Type | Description |
---|---|
System.String | The found cache key or null if no suitable property was found or if the model is null. |
Remarks
will only work on properties of type MediaReference or MediaReferenceList<T> of MediaReference. All other properties will have a null return value
GetImageVaultPropertyCacheKey<T>(ViewContext)
Gets a cache key based on the current property
Declaration
public static string GetImageVaultPropertyCacheKey<T>(this ViewContext ctx)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Mvc.ViewContext | ctx |
Returns
Type | Description |
---|---|
System.String | The found cache key or null if no suitable property was found or if the model is null. |
Type Parameters
Name | Description |
---|---|
T | The type of data that the cache should be storing. |
Remarks
will only work on properties of type MediaReference or MediaReferenceList<T> of MediaReference. All other properties will have a null return value
GetPublishDetails(ViewContext, String)
Gets a EPiServerPublishDetails from the current context
Declaration
public static EPiServerPublishDetails GetPublishDetails(this ViewContext ctx, string channelNames = null)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Mvc.ViewContext | ctx | |
System.String | channelNames |
Returns
Type | Description |
---|---|
EPiServerPublishDetails |
GetSettings<T>(ViewContext)
Get the property settings for the current property
Declaration
public static T GetSettings<T>(this ViewContext ctx)
where T : class, IPropertySettings
Parameters
Type | Name | Description |
---|---|---|
System.Web.Mvc.ViewContext | ctx |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |