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
assemblyAssemblyThe assembly containing the embedded resources.
resourcePrefixstringA dot-separated prefix identifying the root of the embedded resource tree (e.g.
"EncDotNet.S100.Specifications.content.S111.pc").
Returns
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
relativePathstringA forward-slash separated relative path to the asset.
cancellationTokenCancellationTokenA cancellation token.