Table of Contents

Interface IAssetContext

Namespace
Icy.Assets
Assembly
IcyUI.dll

Represents a generalized source to access assets from.

public interface IAssetContext
Extension Methods

Properties

RootPath

Gets the root path for this context.

Uri RootPath { get; }

Property Value

Uri

Methods

Combine(string)

Combines the asset context instance with a relative path to produce a new local asset context.

IAssetContext Combine(string relativePath)

Parameters

relativePath string

A relative path to create a new context for.

Returns

IAssetContext

New instance of the IAssetContext that refers to the combined path.

GetAbsolutePath(string?)

Gets the absolute path to the given relative path relative to this IAssetContext instance.

string GetAbsolutePath(string? relativePath = null)

Parameters

relativePath string

A relative path to make absolute path for.

Returns

string

An absolute path for the specified path combination.

GetDataFormat(string?)

Tries to get data format of the resource specified by current asset context state.

string? GetDataFormat(string? relativePath = null)

Parameters

relativePath string

A relative path to get the format for.

Returns

string

A string representing MIME-type for the specified Uri or null in case when format cannot be determined.

IsAvailable(string?)

Checks if the path represented by the given relative path exists.

bool IsAvailable(string? relativePath = null)

Parameters

relativePath string

Relative path part for this context.

Returns

bool

true if the path exists; false otherwise.

OpenStream(string?)

Opens a stream to the specified relative path.

Stream OpenStream(string? relativePath = null)

Parameters

relativePath string

Optional relative path to open the stream to.

Returns

Stream

An instance of the Stream to the specified asset.

OpenStreamAsync(string?)

Asynchronously opens a stream to the specified relative path.

Task<Stream> OpenStreamAsync(string? relativePath = null)

Parameters

relativePath string

Optional relative path to open the stream to.

Returns

Task<Stream>

An asynchronous task that results to an instance of the Stream to the specified asset.