Table of Contents

Class Asset

Namespace
VpnHood.Net.Toolkit.Assets
Assembly
VpnHood.Net.Toolkit.dll

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

assetProvider IAssetProvider

The provider.

assetPath string

The asset's path.

Methods

OpenReadAsync(CancellationToken)

Opens the asset.

public Task<Stream> OpenReadAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The 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.