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
requestedTypeTypeType of the requested resource.
Returns
- object
An instance of
requestedTypeto be used as a fallback resource for typerequestedType.
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
Tto be used as a fallback resource for typeT.
Type Parameters
TType of the requested resource.
GetResource(string, Type?)
Gets the resource related to the specified key.
object GetResource(string key, Type? targetType = null)
Parameters
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
keystringKey to access the specified resource.
Returns
- T
The requested resource instance.
Type Parameters
TType of the requested resource.
Exceptions
- KeyNotFoundException
Occurs when the requested resource not found.
- ArgumentException
Occurs when the requested resource type doesn't match the
Ttype.
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
instanceTAn instance of
Tto be used as a fallback resource for typeT.
Type Parameters
TType of the requested resource.