Interface IImageProvider
Represents an image provider used to find and download original images.
Namespace: AdaptiveImages.Providers
Assembly: AdaptiveImages.dll
Syntax
public interface IImageProvider
Properties
DisplayName
Gets or sets the name to display in the user interface.
Declaration
string DisplayName { get; }
Property Value
| Type | Description |
|---|---|
| string |
MetadataProperties
Gets the metadata properties supported by this image provider.
Declaration
ImageProviderMetaDataProperty MetadataProperties { get; }
Property Value
| Type | Description |
|---|---|
| ImageProviderMetaDataProperty |
Remarks
Use bitwise OR (|) for multiple properties, for example: ImageProviderMetaDataProperty.Name | ImageProviderMetaDataProperty.Description
Name
Gets the name, i.e. ID, of the provider.
Declaration
string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Options
Gets the option(s) for this image provider.
Declaration
IList<IImageProviderOption> Options { get; }
Property Value
| Type | Description |
|---|---|
| IList<IImageProviderOption> |
Remarks
An image provider must have at least one option.
Methods
DownloadAsync(string)
Gets binary data for a specific image.
Declaration
Task<IImageProviderAssetData> DownloadAsync(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id |
Returns
| Type | Description |
|---|---|
| Task<IImageProviderAssetData> |
GetAsync(string)
Gets metadata for a specific image.
Declaration
Task<IImageProviderAsset> GetAsync(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id |
Returns
| Type | Description |
|---|---|
| Task<IImageProviderAsset> |
GetUrlAsync(string)
Gets the download URL of an image.
Declaration
Task<string> GetUrlAsync(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id |
Returns
| Type | Description |
|---|---|
| Task<string> |
SearchAsync(string?, IEnumerable<IImageProviderOption>?, int?)
Searches for images and returns a result with metadata.
Declaration
Task<IList<IImageProviderAsset>> SearchAsync(string? criteria, IEnumerable<IImageProviderOption>? options = null, int? searchResultPage = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | criteria | Keywords to search for, or left empty if image provider supports listing. |
| IEnumerable<IImageProviderOption> | options | The provider options to apply to the search. |
| int? | searchResultPage | Used for paging to specify which result page should be returned (only applies to provider options with SearchResultPageSize set). |
Returns
| Type | Description |
|---|---|
| Task<IList<IImageProviderAsset>> |
UpdateAsync(IImageProviderAsset, IEnumerable<IImageProviderOption>?)
Updates metadata for an image without altering its binary data.
Declaration
Task<IImageProviderAsset> UpdateAsync(IImageProviderAsset metadata, IEnumerable<IImageProviderOption>? options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IImageProviderAsset | metadata | |
| IEnumerable<IImageProviderOption> | options |
Returns
| Type | Description |
|---|---|
| Task<IImageProviderAsset> |
UploadAsync(IImageProviderAsset, IImageProviderAssetData, IEnumerable<IImageProviderOption>?)
Uploads binary data and metadata for an image.
Declaration
Task<IImageProviderAsset> UploadAsync(IImageProviderAsset metadata, IImageProviderAssetData payload, IEnumerable<IImageProviderOption>? options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IImageProviderAsset | metadata | |
| IImageProviderAssetData | payload | |
| IEnumerable<IImageProviderOption> | options |
Returns
| Type | Description |
|---|---|
| Task<IImageProviderAsset> |