Show / Hide Table of Contents

Class ImageProviderFactory

Used to manage add or remove image providers for sourcing original images

Inheritance
object
ImageProviderFactory
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: AdaptiveImages.Providers
Assembly: AdaptiveImages.dll
Syntax
public sealed class ImageProviderFactory

Properties

Instance

Gets the instance used to add or remove image providers

Declaration
public static ImageProviderFactory Instance { get; }
Property Value
Type Description
ImageProviderFactory

this[string]

Gets a registered image provider by name.

Declaration
public IImageProvider this[string providerName] { get; }
Parameters
Type Name Description
string providerName
Property Value
Type Description
IImageProvider

Resolver

Gets or sets how an image provider is resolved from a specified provider name, if different from the default implementation

Declaration
public Func<string, IImageProvider?> Resolver { get; set; }
Property Value
Type Description
Func<string, IImageProvider>
Remarks

Invoked by the Resolve(string) method. Commonly set to a custom resolver when there is need to map old (or multiple) provider names to a specific provider

Methods

Clear()

Removes all registered image providers

Declaration
public void Clear()

Contains(string)

Checks if an image provider with the specified name has been registered.

Declaration
public bool Contains(string providerName)
Parameters
Type Name Description
string providerName
Returns
Type Description
bool

DefaultResolver(string)

Returns the image provider with the specified name

Declaration
public static IImageProvider? DefaultResolver(string providerName)
Parameters
Type Name Description
string providerName
Returns
Type Description
IImageProvider
Remarks

By default, this method is used for the Resolver property, which in turn is invoked by the Resolve(string) method

List()

Lists all registered image providers

Declaration
public IEnumerable<IImageProvider> List()
Returns
Type Description
IEnumerable<IImageProvider>

Register(IImageProvider)

Adds a new image provider

Declaration
public void Register(IImageProvider provider)
Parameters
Type Name Description
IImageProvider provider
Exceptions
Type Condition
ArgumentException
Exception

Remove(string)

Removes the specified provider if it exists, otherwise the action is ignored

Declaration
public void Remove(string providerName)
Parameters
Type Name Description
string providerName

Resolve(string)

Gets a specific provider if available, otherwise null is returned

Declaration
public IImageProvider? Resolve(string providerName)
Parameters
Type Name Description
string providerName
Returns
Type Description
IImageProvider

Extension Methods

ImageExtensions.GetCultureSpecificImageAttribute<TContent, TProperty>(TContent, Expression<Func<TContent, TProperty>>)
ImageExtensions.GetImageConstraints<TParent>(TParent, string)
ImageExtensions.GetImageConstraints<TParent, TProperty>(TParent, Expression<Func<TParent, TProperty>>)
ImageExtensions.GetImageRenderSettings<TParent, TProperty>(TParent, Expression<Func<TParent, TProperty>>)
ImageExtensions.GetImageRenderSettings<TParent, TProperty>(TParent, Expression<Func<TParent, TProperty>>, FormFactor)
ImageExtensions.GetProportionsConstraint<TParent>(TParent, string)
ImageExtensions.GetProportionsConstraint<TParent>(TParent, string, FormFactor)
ImageExtensions.GetProportionsConstraint<TParent, TProperty>(TParent, Expression<Func<TParent, TProperty>>)
ImageExtensions.GetRequiredImageAttribute<TContent, TProperty>(TContent, Expression<Func<TContent, TProperty>>)
ImageExtensions.GetSizeConstraint<TContent, TProperty>(TContent, Expression<Func<TContent, TProperty>>)
☀
☾
In this article
Back to top
Documentation applies to: Adaptive Images 2.x
☀
☾