In This Article

FileBasedAssemblyRepository Class

Represents an IAssemblyRepository that can cache data in the file system.

public class FileBasedAssemblyRepository : AssemblyRepositoryBase, IAssemblyRepository
Inheritance:
Object AssemblyRepositoryBase Object
Implements:
IAssemblyRepository

Constructors

FileBasedAssemblyRepository(String)

Initializes a new instance of the FileBasedAssemblyRepository class.

public FileBasedAssemblyRepository(string cachePath)
Parameter Type Description
cachePath String

The path to use for assembly and documentation cache files.

Properties

CachePath

Gets or sets the path to use for assembly and documentation cache files.

public string CachePath { get; set; }

Property Value

String:

The path to use for assembly and documentation cache files.

SyncRoot

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

public override 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 override 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 override IBinaryAssembly Create(Assembly assembly, IAssemblyName assemblyName, IBinaryAssemblyMetadata metadata)
Parameter Type Description
assembly Assembly

The Assembly to examine.

assemblyName IAssemblyName

The IAssemblyName to use.

metadata IBinaryAssemblyMetadata

The assembly metadata.

Returns

IBinaryAssembly

GetOrCreate(Assembly, IAssemblyName, String)

Gets an existing or creates a new IBinaryAssembly for the specified Assembly.

protected override IBinaryAssembly GetOrCreate(Assembly assembly, IAssemblyName assemblyName, string location)
Parameter Type Description
assembly Assembly

The Assembly to examine.

assemblyName IAssemblyName

The IAssemblyName to use.

location String

The assembly location, if known.

Returns

IBinaryAssembly

PruneCache()

Deletes any cache-related files in the CachePath that are no longer valid.

public override void PruneCache()

Remarks

Call this method upon the shutdown of your application to ensure out-of-date cache files aren't retained.

Remove(IBinaryAssembly)

Removes a reference to an IBinaryAssembly.

public override 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.

Inherited Members