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 an instance of the class.

public FileBasedAssemblyRepository(string? cachePath)
Parameter Type Description
cachePath string

The path to use for assembly and documentation cache files.

Properties

CachePath

The path to use for assembly and documentation cache files.

public string? CachePath { get; set; }

Property Value

string

SyncRoot

An object that can be used to synchronize access to the repository.

public override object SyncRoot { get; }

Property Value

object

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 data that is no longer valid.

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

Extension Methods