Interface IImageSourceParser
Provides methods to parse image tag sources in property values.
Namespace: Umbraco.Cms.Core.Deploy
Assembly: Umbraco.Core.dll
Syntax
public interface IImageSourceParser
Methods
View SourceFromArtifactAsync(String, IContextCache, CancellationToken)
Parses an artifact property value and produces an Umbraco property value.
Declaration
Task<string> FromArtifactAsync(string value, IContextCache contextCache, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The artifact property value. |
IContextCache | contextCache | The context cache. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<System.String> | A task that represents the asynchronous operation. The task result contains the parsed value. |
Remarks
Turns umb://media/... into /media/....
ToArtifactAsync(String, ICollection<Udi>, IContextCache, CancellationToken)
Parses an Umbraco property value and produces an artifact property value.
Declaration
Task<string> ToArtifactAsync(string value, ICollection<Udi> dependencies, IContextCache contextCache, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The property value. |
ICollection<Udi> | dependencies | A list of dependencies. |
IContextCache | contextCache | The context cache. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<System.String> | A task that represents the asynchronous operation. The task result contains the parsed value. |
Remarks
Turns src="/media/..." into src="umb://media/..." and adds the corresponding udi to the dependencies.