Class DefaultResourceProvider
- Namespace
- Acuit.Pinpoint.ResourceManagement
- Assembly
- Acuit.Pinpoint.ResourceManagement.dll
A default resource provider implementation.
public class DefaultResourceProvider : IResourceProviderRegistry, IResourceProvider
- Inheritance
-
DefaultResourceProvider
- Implements
- Inherited Members
Constructors
DefaultResourceProvider()
Initializes a new instance of the DefaultResourceProvider class.
public DefaultResourceProvider()
Methods
CreateResourceReference(Uri)
Creates a reference to a resource.
public virtual IResourceReference CreateResourceReference(Uri url)
Parameters
url
UriThe resource URL.
Returns
- IResourceReference
A IResourceReference that can be used to access the resource and that should be disposed when the resource reference is no longer needed.
Exceptions
- ArgumentNullException
url
is null.- InvalidOperationException
url
cannot be resolved to a known resource location.
RegisterResourceProvider(IRegisteredResourceProvider)
Registers a resource provider.
public IDisposable RegisterResourceProvider(IRegisteredResourceProvider resourceProvider)
Parameters
resourceProvider
IRegisteredResourceProviderThe resource provider.
Returns
- IDisposable
A IDisposable that represents the registration. Calling Dispose() will remove the resource provider registration.
Remarks
The resource provider registry will not assume ownership of resourceProvider
. For example, if resourceProvider
implements IDisposable, then
the creator of the provider is responsible for disposing of it after first removing the resource provider registration by disposing the IDisposable returned by this method.
Exceptions
- ArgumentNullException
resourceProvider
is null.- InvalidOperationException
The
resourceProvider
instance is already registered.