Class ClientExtensionMethods
Extension methods for the ImageVault.Client.Client class that allows easy access to media when working with episerver properties
Inheritance
Inherited Members
Namespace: ImageVault.EPiServer
Assembly: ImageVault.EPiServer.dll
Syntax
public static class ClientExtensionMethods
Methods
GetChannelMedia<T>(IClient, IEnumerable<MediaReference>, IUserPublishDetailsData, PropertyMediaSettings)
Declaration
public static IList<T> GetChannelMedia<T>(this IClient client, IEnumerable<MediaReference> mediaReferences, IUserPublishDetailsData publishDetails, PropertyMediaSettings settings)
where T : ChannelDisplayMediaItem
Parameters
Type | Name | Description |
---|---|---|
IClient | client | |
System.Collections.Generic.IEnumerable<MediaReference> | mediaReferences | |
IUserPublishDetailsData | publishDetails | |
PropertyMediaSettings | settings |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<T> |
Type Parameters
Name | Description |
---|---|
T |
GetChannelMedia<T>(IClient, IEnumerable<MediaReference>, ViewContext, PropertyMediaSettings)
Declaration
public static IList<T> GetChannelMedia<T>(this IClient client, IEnumerable<MediaReference> mediaReferences, ViewContext viewContext, PropertyMediaSettings settings = null)
where T : ChannelDisplayMediaItem
Parameters
Type | Name | Description |
---|---|---|
IClient | client | |
System.Collections.Generic.IEnumerable<MediaReference> | mediaReferences | |
System.Web.Mvc.ViewContext | viewContext | |
PropertyMediaSettings | settings |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<T> |
Type Parameters
Name | Description |
---|---|
T |
Load<T>(Client, MediaReference)
Gets a list of media selected in the property
Declaration
[Obsolete("Use client.Load<T>(MediaReference, PropertyMediaSettings) instead. This method will include all effects from both MediaReference and PropertyMediaSettings.")]
public static IIVQueryable<T> Load<T>(this Client client, MediaReference mediaReference)
where T : IItem<int>
Parameters
Type | Name | Description |
---|---|---|
Client | client | The IClient to use to get the media |
MediaReference | mediaReference | The MediaReference that contains the selected media |
Returns
Type | Description |
---|---|
IIVQueryable<T> | The requested IIVQueryable<T> of IItem<T> |
Type Parameters
Name | Description |
---|---|
T | The type of IItem<T> to get |
Load<T>(Client, PropertyMedia)
Gets a list of media selected in the property
Declaration
[Obsolete("Use Client.Load<T>(PropertyMedia, PropertyMediaSettings) instead. This method will include all effects from both PropertyMedia and PropertyMediaSettings.")]
public static IIVQueryable<T> Load<T>(this Client client, PropertyMedia propertyMedia)
where T : IItem<int>
Parameters
Type | Name | Description |
---|---|---|
Client | client | The IClient to use to get the media |
PropertyMedia | propertyMedia | The PropertyMedia that contains the selected media |
Returns
Type | Description |
---|---|
IIVQueryable<T> | The requested IIVQueryable<T> of IItem<T> |
Type Parameters
Name | Description |
---|---|
T | The type of IItem<T> to get |
Load<T>(Client, PropertyMediaList)
Gets a list of media selected in the property
Declaration
[Obsolete("Use client.Load<T>(PropertyMediaList, PropertyMediaSettings) instead. This method will include all effects from both PropertyMediaList and PropertyMediaSettings.")]
public static IIVQueryable<T> Load<T>(this Client client, PropertyMediaList propertyMediaList)
where T : IItem<int>
Parameters
Type | Name | Description |
---|---|---|
Client | client | The IClient to use to get the media |
PropertyMediaList | propertyMediaList | The PropertyMediaList that contains the selected media |
Returns
Type | Description |
---|---|
IIVQueryable<T> | The requested IIVQueryable<T> of IItem<T> |
Type Parameters
Name | Description |
---|---|
T | The type of IItem<T> to get |
Load<T>(Client, IEnumerable<MediaReference>)
Gets a list of media selected in the property
Declaration
[Obsolete("Use client.Load<T>(IEnumerable<MediaReference>, PropertyMediaSettings) instead. This method will include all effects from both IEnumerable<MediaReference> and PropertyMediaSettings.")]
public static IIVQueryable<T> Load<T>(this Client client, IEnumerable<MediaReference> mediaReferenceList)
where T : IItem<int>
Parameters
Type | Name | Description |
---|---|---|
Client | client | The IClient to use to get the media |
System.Collections.Generic.IEnumerable<MediaReference> | mediaReferenceList | The System.Collections.Generic.IEnumerable<T> that contains the selected media |
Returns
Type | Description |
---|---|
IIVQueryable<T> | The requested IIVQueryable<T> of IItem<T> |
Type Parameters
Name | Description |
---|---|
T | The type of IItem<T> to get |
Load<T>(IClient, MediaReference, PropertyMediaSettings)
Gets the media selected in the property
Declaration
[Obsolete("Use client.Load<T>(MediaReference,ViewContext,PropertyMediaSettings) instead. This method will not track Usage.")]
public static IIVQueryable<T> Load<T>(this IClient client, MediaReference mediaReference, PropertyMediaSettings settings)
Parameters
Type | Name | Description |
---|---|---|
IClient | client | The IClient to use to get the media |
MediaReference | mediaReference | The MediaReference that contains the selected media (and effects) |
PropertyMediaSettings | settings | Optional settings parameter for any PropertyMediaSettings for the property |
Returns
Type | Description |
---|---|
IIVQueryable<T> | The requested IIVQueryable<T> of the requested |
Type Parameters
Name | Description |
---|---|
T | The type of media to get. Can be a Media (or subclass) or a MediaItem (or subclass). |
Load<T>(IClient, MediaReference, ViewContext, PropertyMediaSettings)
Gets the media selected in the property
Declaration
public static IIVQueryable<T> Load<T>(this IClient client, MediaReference mediaReference, ViewContext viewContext, PropertyMediaSettings settings = null)
Parameters
Type | Name | Description |
---|---|---|
IClient | client | The IClient to use to get the media |
MediaReference | mediaReference | The MediaReference that contains the selected media (and effects) |
System.Web.Mvc.ViewContext | viewContext | The System.Web.Mvc.ViewContext used to get PropertyMediaSettings and tracking information using a EPiServerPublishDetails instance created by the GetPublishDetails(ViewContext, String) method |
PropertyMediaSettings | settings | Optional settings parameter for any PropertyMediaSettings for the property. If not provided (or null) PropertyMediaSettings are retrieved from the |
Returns
Type | Description |
---|---|
IIVQueryable<T> | The requested IIVQueryable<T> of the requested |
Type Parameters
Name | Description |
---|---|
T | The type of media to get. Can be a Media (or subclass) or a MediaItem (or subclass). |
Load<T>(IClient, PropertyMedia, PropertyMediaSettings)
Gets the media selected in the property
Declaration
[Obsolete("Use client.Load<T>(PropertyMedia,ViewContext,PropertyMediaSettings) instead. This method will not track Usage.")]
public static IIVQueryable<T> Load<T>(this IClient client, PropertyMedia propertyMedia, PropertyMediaSettings settings)
Parameters
Type | Name | Description |
---|---|---|
IClient | client | The IClient to use to get the media |
PropertyMedia | propertyMedia | The PropertyMedia that contains the selected media (and effects) |
PropertyMediaSettings | settings | Optional settings parameter for any PropertyMediaSettings for the property |
Returns
Type | Description |
---|---|
IIVQueryable<T> | The requested IIVQueryable<T> of the requested |
Type Parameters
Name | Description |
---|---|
T | The type of media to get. Can be a Media (or subclass) or a MediaItem (or subclass). |
Load<T>(IClient, PropertyMedia, ViewContext, PropertyMediaSettings)
Gets the media selected in the property
Declaration
public static IIVQueryable<T> Load<T>(this IClient client, PropertyMedia propertyMedia, ViewContext viewContext, PropertyMediaSettings settings = null)
Parameters
Type | Name | Description |
---|---|---|
IClient | client | The IClient to use to get the media |
PropertyMedia | propertyMedia | The PropertyMedia that contains the selected media (and effects) |
System.Web.Mvc.ViewContext | viewContext | The System.Web.Mvc.ViewContext used to get PropertyMediaSettings and tracking information using a EPiServerPublishDetails instance created by the GetPublishDetails(ViewContext, String) method |
PropertyMediaSettings | settings | Optional settings parameter for any PropertyMediaSettings for the property. If not provided (or null) PropertyMediaSettings are retrieved from the |
Returns
Type | Description |
---|---|
IIVQueryable<T> | The requested IIVQueryable<T> of the requested |
Type Parameters
Name | Description |
---|---|
T | The type of media to get. Can be a Media (or subclass) or a MediaItem (or subclass). |
Load<T>(IClient, PropertyMediaList, PropertyMediaSettings)
Gets the media selected in the property
Declaration
[Obsolete("Use client.Load<T>(PropertyMediaList,ViewContext,PropertyMediaSettings) instead. This method will not track Usage.")]
public static IIVQueryable<T> Load<T>(this IClient client, PropertyMediaList propertyMediaList, PropertyMediaSettings settings)
Parameters
Type | Name | Description |
---|---|---|
IClient | client | The IClient to use to get the media |
PropertyMediaList | propertyMediaList | The PropertyMediaList that contains the selected media (and effects) |
PropertyMediaSettings | settings | Optional settings parameter for any PropertyMediaSettings for the property |
Returns
Type | Description |
---|---|
IIVQueryable<T> | The requested IIVQueryable<T> of the requested |
Type Parameters
Name | Description |
---|---|
T | The type of media to get. Can be a Media (or subclass) or a MediaItem (or subclass). |
Load<T>(IClient, PropertyMediaList, ViewContext, PropertyMediaSettings)
Gets the media selected in the property
Declaration
public static IIVQueryable<T> Load<T>(this IClient client, PropertyMediaList propertyMediaList, ViewContext viewContext, PropertyMediaSettings settings = null)
Parameters
Type | Name | Description |
---|---|---|
IClient | client | The IClient to use to get the media |
PropertyMediaList | propertyMediaList | The PropertyMediaList that contains the selected media (and effects) |
System.Web.Mvc.ViewContext | viewContext | The System.Web.Mvc.ViewContext used to get PropertyMediaSettings and tracking information using a EPiServerPublishDetails instance created by the GetPublishDetails(ViewContext, String) method |
PropertyMediaSettings | settings | Optional settings parameter for any PropertyMediaSettings for the property. If not provided (or null) PropertyMediaSettings are retrieved from the |
Returns
Type | Description |
---|---|
IIVQueryable<T> | The requested IIVQueryable<T> of the requested |
Type Parameters
Name | Description |
---|---|
T | The type of media to get. Can be a Media (or subclass) or a MediaItem (or subclass). |
Load<T>(IClient, IEnumerable<MediaReference>, PropertyMediaSettings)
Gets the media selected in the property
Declaration
[Obsolete("Use client.Load<T>(IEnumerable<MediaReferences>,ViewContext,PropertyMediaSettings) instead. This method will not track Usage.")]
public static IIVQueryable<T> Load<T>(this IClient client, IEnumerable<MediaReference> mediaReferences, PropertyMediaSettings settings)
Parameters
Type | Name | Description |
---|---|---|
IClient | client | The IClient to use to get the media |
System.Collections.Generic.IEnumerable<MediaReference> | mediaReferences | The System.Collections.Generic.IEnumerable<T> of MediaReference that contains the selected media (and effects) |
PropertyMediaSettings | settings | Optional settings parameter for any PropertyMediaSettings for the property |
Returns
Type | Description |
---|---|
IIVQueryable<T> | The requested IIVQueryable<T> of the requested |
Type Parameters
Name | Description |
---|---|
T | The type of media to get. Can be a Media (or subclass) or a MediaItem (or subclass). |
Load<T>(IClient, IEnumerable<MediaReference>, ViewContext, PropertyMediaSettings)
Gets the media selected in the property
Declaration
public static IIVQueryable<T> Load<T>(this IClient client, IEnumerable<MediaReference> mediaReferences, ViewContext viewContext, PropertyMediaSettings settings = null)
Parameters
Type | Name | Description |
---|---|---|
IClient | client | The IClient to use to get the media |
System.Collections.Generic.IEnumerable<MediaReference> | mediaReferences | The System.Collections.Generic.IEnumerable<T> of MediaReference that contains the selected media (and effects) |
System.Web.Mvc.ViewContext | viewContext | The System.Web.Mvc.ViewContext used to get PropertyMediaSettings and tracking information using a EPiServerPublishDetails instance created by the GetPublishDetails(ViewContext, String) method |
PropertyMediaSettings | settings | Optional settings parameter for any PropertyMediaSettings for the property. If not provided (or null) PropertyMediaSettings are retrieved from the |
Returns
Type | Description |
---|---|
IIVQueryable<T> | The requested IIVQueryable<T> of the requested |
Type Parameters
Name | Description |
---|---|
T | The type of media to get. Can be a Media (or subclass) or a MediaItem (or subclass). |
UsedOn<T>(IIVQueryable<T>, PageData, String)
Adds UsedOn tracking for the current page and property
Declaration
public static IIVQueryable<T> UsedOn<T>(this IIVQueryable<T> source, PageData currentPage, string propertyName)
Parameters
Type | Name | Description |
---|---|---|
IIVQueryable<T> | source | |
EPiServer.Core.PageData | currentPage | The current page where the asset is used |
System.String | propertyName | The name of the property where the asset is defined |
Returns
Type | Description |
---|---|
IIVQueryable<T> |
Type Parameters
Name | Description |
---|---|
T |
UsedOn<T>(IIVQueryable<T>, String)
Adds UsedOn tracking for the supplied name.
Declaration
public static IIVQueryable<T> UsedOn<T>(this IIVQueryable<T> source, string name)
Parameters
Type | Name | Description |
---|---|---|
IIVQueryable<T> | source | |
System.String | name | The name to register for tracking |
Returns
Type | Description |
---|---|
IIVQueryable<T> |
Type Parameters
Name | Description |
---|---|
T |