In This Article

IAssemblyRepository Interface

Provides the base requirements for a class that manages IAssembly instances and caching of data as appropriate.

public interface IAssemblyRepository

Properties

SyncRoot

Gets an object that can be used to synchronize access to the repository.

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.

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.

Load(Assembly)

Creates a new IBinaryAssembly instance from the specified Assembly.

IBinaryAssembly Load(Assembly assembly)
Parameter Type Description
assembly Assembly

The Assembly to examine.

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.

IBinaryAssembly Load(Assembly assembly, IAssemblyName assemblyName)
Parameter Type Description
assembly Assembly

The Assembly to examine.

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.

IBinaryAssembly Load(string fullName)
Parameter Type Description
fullName string

The Assembly full name for which to load.

Returns

IBinaryAssembly:

The IBinaryAssembly that was created.

LoadFrom(string)

Creates a new IBinaryAssembly instance from the Assembly at the specified path.

IBinaryAssembly LoadFrom(string path)
Parameter Type Description
path string

The path to the Assembly file to load.

Returns

IBinaryAssembly:

The IBinaryAssembly that was created.

PruneCache()

Deletes any cache data that is no longer valid.

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.

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.