Class ResourceManager
Represents a resource manager that can be used to load and release sets of resources at run time, and manage their lifespan. Disposing the resource manager will also dispose of any loaded resources.
public sealed class ResourceManager : IDisposable
- Inheritance
-
ResourceManager
- Implements
- Inherited Members
Methods
Dispose()
Releases all resources used by the ResourceManager class.
public void Dispose()
Load(IEnumerable<IResourceConfiguration>)
Loads a set of resources into the resource manager.
public IDisposable Load(IEnumerable<IResourceConfiguration> source)
Parameters
source
IEnumerable<IResourceConfiguration>A collection of resources to load into the resource manager.
Returns
- IDisposable
A IDisposable object which can be used to unload the loaded resources.
Load<TResource>(string)
Loads the resource with the specified name into the resource manager.
public TResource Load<TResource>(string name) where TResource : IDisposable
Parameters
name
stringThe name of the resource to load.
Returns
- TResource
The loaded resource. Repeated calls to load the same resource will return the same object instance.
Type Parameters
TResource
The type of the loaded resource.