Table of Contents

Class AssetExtensions

Namespace
Icy.Assets
Assembly
IcyUI.dll

Provides some extension methods for the assets management.

public static class AssetExtensions
Inheritance
AssetExtensions
Inherited Members

Methods

TryGetResource(IResourceRegistry, string, out object?, Type?)

Tries to get the resource from the specified resource registry.

public static bool TryGetResource(this IResourceRegistry resources, string key, out object? result, Type? targetType = null)

Parameters

resources IResourceRegistry

An instance of the IResourceRegistry to access the specified resource.

key string

A key to access the specified resource.

result object

An instance of the requested resource..

targetType Type

Optional type constraint for the requested resource.

Returns

bool

true if the resource have been found and returned successfully; otherwise false.

TryGetResource<T>(IResourceRegistry, string, out T?)

Tries to get the resource from the specified resource registry.

public static bool TryGetResource<T>(this IResourceRegistry resources, string key, out T? result) where T : class

Parameters

resources IResourceRegistry

An instance of the IResourceRegistry to access the specified resource.

key string

A key to access the specified resource.

result T

An instance of the requested resource.

Returns

bool

true if the resource have been found and returned successfully; otherwise false.

Type Parameters

T

Type of the requested resource.