Class ResourceProvider
- Namespace
- Acuit.Pinpoint.ResourceManagement
- Assembly
- Acuit.Pinpoint.ResourceManagement.Abstractions.dll
A base class for implementing resource providers.
public abstract class ResourceProvider : IResourceProvider, IDisposable
- Inheritance
-
ResourceProvider
- Implements
- Inherited Members
Remarks
This base class provides the common logic to track resource references.
Implementations deriving from this class must also implement a class derived from ReferencedResource, and provide an implementation for CreateReferencedResource(Uri) here that returns an instance of the ReferencedResource-derived class.
Constructors
ResourceProvider()
Initializes a new instance of the ResourceProvider class.
protected ResourceProvider()
Methods
CreateReferencedResource(Uri)
Creates a new referenced resource for a specified URL.
protected abstract ReferencedResource CreateReferencedResource(Uri url)
Parameters
url
UriThe resource URL.
Returns
- ReferencedResource
A new instance of a class derived from ReferencedResource that represents the resource.
Exceptions
- ArgumentNullException
url
is null.
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.
Dispose()
Closes and releases all resources used by the object.
public void Dispose()
Dispose(bool)
Closes and releases all resources used by the ResourceProvider.
protected virtual void Dispose(bool disposing)
Parameters
Remarks
Derived classes should override this when they have any resources that should be disposed.