Class Asset
Represents the asset a provider serves at a path: the two as one value, to hand about. It answers what the provider answers.
public class Asset : IAsset
- Inheritance
-
Asset
- Implements
- Inherited Members
Constructors
Asset(IAssetProvider, string)
Represents the asset a provider serves at a path: the two as one value, to hand about. It answers what the provider answers.
public Asset(IAssetProvider assetProvider, string assetPath)
Parameters
assetProviderIAssetProviderThe provider.
assetPathstringThe asset's path.
Methods
OpenReadAsync(CancellationToken)
Opens the asset.
public Task<Stream> OpenReadAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task<Stream>
A task whose result is a new stream, which the caller owns and disposes; read it forward.
Exceptions
- AssetNotFoundException
There is no such asset.
ToString()
Returns the asset's path.
public override string ToString()
Returns
- string
The path.