Table of Contents

Interface IResourceRegistry

Namespace
Icy.Assets
Assembly
IcyUI.dll

Represents a service for the UI resources storage.

public interface IResourceRegistry : IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable
Inherited Members
Extension Methods

Methods

GetFallbackResource(Type)

Gets an instance of the resource to be used in case when according resource couldn't be found.

object? GetFallbackResource(Type requestedType)

Parameters

requestedType Type

Type of the requested resource.

Returns

object

An instance of requestedType to be used as a fallback resource for type requestedType.

GetFallbackResource<T>()

Gets an instance of the resource to be used in case when according resource couldn't be found.

T? GetFallbackResource<T>() where T : class

Returns

T

An instance of T to be used as a fallback resource for type T.

Type Parameters

T

Type of the requested resource.

GetResource(string, Type?)

Gets the resource related to the specified key.

object GetResource(string key, Type? targetType = null)

Parameters

key string

Key to access the specified resource.

targetType Type

Type of the requested resource.

Returns

object

The requested resource.

Exceptions

KeyNotFoundException

Occurs when the requested resource not found.

ArgumentException

Occurs when the requested resource type doesn't match the targetType.

GetResource<T>(string)

Gets the resource related to the specified key.

T GetResource<T>(string key) where T : class

Parameters

key string

Key to access the specified resource.

Returns

T

The requested resource instance.

Type Parameters

T

Type of the requested resource.

Exceptions

KeyNotFoundException

Occurs when the requested resource not found.

ArgumentException

Occurs when the requested resource type doesn't match the T type.

SetFallbackResource<T>(T)

Sets an instance of the resource of type T for the case when according resource couldn't be found.

void SetFallbackResource<T>(T instance) where T : class

Parameters

instance T

An instance of T to be used as a fallback resource for type T.

Type Parameters

T

Type of the requested resource.