AssemblyRepositoryBase Class
Provides the abstract base class for an IAssemblyRepository implementation.
public abstract class AssemblyRepositoryBase : IAssemblyRepository
- Inheritance:
- object object
- Derived:
- FileBasedAssemblyRepository
- Implements:
- IAssemblyRepository
Constructors
AssemblyRepositoryBase()
Initializes an instance of the class.
protected AssemblyRepositoryBase()
Properties
SyncRoot
Gets an object that can be used to synchronize access to the repository.
public abstract object SyncRoot { get; }
Property Value
- object:
An object that can be used to synchronize access to the repository.
Methods
Add(IBinaryAssembly)
Adds a reference to an IBinaryAssembly.
public abstract void Add(IBinaryAssembly assembly)
Parameter | Type | Description |
---|---|---|
assembly | IBinaryAssembly | The IBinaryAssembly that is referenced. |
Remarks
The specified assembly will be tracked while there are remaining references to it. While tracked, the various Load(string) methods will return the already-loaded instance when appropriate.
Create(Assembly, IAssemblyName, IBinaryAssemblyMetadata)
Creates a new IBinaryAssembly for the specified Assembly
.
protected virtual IBinaryAssembly Create(Assembly assembly, IAssemblyName assemblyName, IBinaryAssemblyMetadata metadata)
Parameter | Type | Description |
---|---|---|
assembly | Assembly | The |
assemblyName | IAssemblyName | The IAssemblyName to use. |
metadata | IBinaryAssemblyMetadata | The assembly metadata. |
Returns
GetOrCreate(Assembly, IAssemblyName, string)
Gets an existing or creates a new IBinaryAssembly for the specified Assembly
.
protected abstract IBinaryAssembly GetOrCreate(Assembly assembly, IAssemblyName assemblyName, string location)
Parameter | Type | Description |
---|---|---|
assembly | Assembly | The |
assemblyName | IAssemblyName | The IAssemblyName to use. |
location | string | The assembly location, if known. |
Returns
Load(Assembly)
Creates a new IBinaryAssembly instance from the specified Assembly.
public IBinaryAssembly Load(Assembly assembly)
Parameter | Type | Description |
---|---|---|
assembly | Assembly | The |
Returns
- IBinaryAssembly:
The IBinaryAssembly that was created.
Load(Assembly, IAssemblyName)
Creates a new IBinaryAssembly instance from the specified Assembly, but stores it with an alternate AssemblyName, which is useful for dynamically generated assemblies.
public IBinaryAssembly Load(Assembly assembly, IAssemblyName assemblyName)
Parameter | Type | Description |
---|---|---|
assembly | Assembly | The |
assemblyName | IAssemblyName | The alternate AssemblyName to use. |
Returns
- IBinaryAssembly:
The IBinaryAssembly that was created.
Load(string)
Creates a new IBinaryAssembly instance from the specified Assembly name.
public IBinaryAssembly Load(string fullName)
Parameter | Type | Description |
---|---|---|
fullName | string | The |
Returns
- IBinaryAssembly:
The IBinaryAssembly that was created.
LoadFrom(string)
Creates a new IBinaryAssembly instance from the Assembly at the specified path.
public IBinaryAssembly LoadFrom(string path)
Parameter | Type | Description |
---|---|---|
path | string | The path to the |
Returns
- IBinaryAssembly:
The IBinaryAssembly that was created.
PruneCache()
Deletes any cache data that is no longer valid.
public abstract void PruneCache()
Remarks
Call this method upon the shutdown of your application to ensure out-of-date cache data isn't retained.
Remove(IBinaryAssembly)
Removes a reference to an IBinaryAssembly.
public abstract void Remove(IBinaryAssembly assembly)
Parameter | Type | Description |
---|---|---|
assembly | IBinaryAssembly | The IBinaryAssembly that is no longer referenced. |
Remarks
When no references remain for the assembly, it will no longer be tracked.