Class ClientExtensionMethods
Extension methods for the ImageVault.Client.Client class that allows easy access to media when working with episerver properties
Inheritance
Namespace: ImageVault.EPiServer
Assembly: ImageVault.EPiServer.dll
Syntax
public static class ClientExtensionMethods : Object
Methods
GetChannelMedia<T>(IClient, IEnumerable<MediaReference>, IUserPublishDetailsData, PropertyMediaSettings)
Gets the media for the active channel
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)
Gets the requested media for the active channel
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 | |
Microsoft.AspNetCore.Mvc.Rendering.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
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
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, IEnumerable<MediaReference>)
Gets a list of media selected in the property
Declaration
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<> 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
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) |
Microsoft.AspNetCore.Mvc.Rendering.ViewContext | viewContext | The Microsoft.AspNetCore.Mvc.Rendering.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
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) |
Microsoft.AspNetCore.Mvc.Rendering.ViewContext | viewContext | The Microsoft.AspNetCore.Mvc.Rendering.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
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<> 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<> of MediaReference that contains the selected media (and effects) |
Microsoft.AspNetCore.Mvc.Rendering.ViewContext | viewContext | The Microsoft.AspNetCore.Mvc.Rendering.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 |