Table of Contents

Class EmbeddedAssetSource

Namespace
EncDotNet.S100.Specifications
Assembly
EncDotNet.S100.Specifications.dll

An asset source backed by embedded resources within an assembly.

public sealed class EmbeddedAssetSource : IAssetSource, IDisposable, IAsyncDisposable
Inheritance
EmbeddedAssetSource
Implements
Inherited Members

Methods

Create(Assembly, string)

Creates an EmbeddedAssetSource rooted at the given resource path prefix within the specified assembly.

public static EmbeddedAssetSource Create(Assembly assembly, string resourcePrefix)

Parameters

assembly Assembly

The assembly containing the embedded resources.

resourcePrefix string

A dot-separated prefix identifying the root of the embedded resource tree (e.g. "EncDotNet.S100.Specifications.content.S111.pc").

Returns

EmbeddedAssetSource

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

OpenAsync(string, CancellationToken)

Opens a readable stream for the asset at the given relative path within the source.

public Task<Stream> OpenAsync(string relativePath, CancellationToken cancellationToken = default)

Parameters

relativePath string

A forward-slash separated relative path to the asset.

cancellationToken CancellationToken

A cancellation token.

Returns

Task<Stream>