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 SourceFromArtifact(String, IContextCache)
Parses an artifact property value and produces an Umbraco property value.
Declaration
string FromArtifact(string value, IContextCache contextCache)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The artifact property value. |
IContextCache | contextCache | The context cache. |
Returns
Type | Description |
---|---|
System.String | The parsed value. |
Remarks
Turns umb://media/... into /media/....
FromArtifactAsync(String, IContextCache, CancellationToken)
Parses an artifact property value and produces an Umbraco property value.
Declaration
virtual 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/....
ToArtifact(String, ICollection<Udi>, IContextCache)
Parses an Umbraco property value and produces an artifact property value.
Declaration
string ToArtifact(string value, ICollection<Udi> dependencies, IContextCache contextCache)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The property value. |
ICollection<Udi> | dependencies | A list of dependencies. |
IContextCache | contextCache | The context cache. |
Returns
Type | Description |
---|---|
System.String | The parsed value. |
Remarks
Turns src="/media/..." into src="umb://media/..." and adds the corresponding udi to the dependencies.
ToArtifactAsync(String, ICollection<Udi>, IContextCache, CancellationToken)
Parses an Umbraco property value and produces an artifact property value.
Declaration
virtual 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.