ICompilerCache

Ecng.Compilation

Defines methods for caching compiled assemblies.

プロパティ

Count
public int Count { get; }
value = iCompilerCache.Count

Gets the number of cached assemblies.

メソッド

Add
public void Add(string ext, IEnumerable<string> sources, IEnumerable<string> refs, byte[] assembly)
iCompilerCache.Add(ext, sources, refs, assembly)

Adds a compiled assembly to the cache.

ext
The file extension used in key generation.
sources
The source code files.
refs
The referenced assemblies.
assembly
The compiled assembly bytes to cache.
Clear
public void Clear()
iCompilerCache.Clear()

Clears all cached assemblies.

InitAsync
public ValueTask InitAsync(CancellationToken cancellationToken)
result = iCompilerCache.InitAsync(cancellationToken)

Initializes the cache.

cancellationToken
Cancellation token.

戻り値: A task representing the asynchronous operation.

Remove
public bool Remove(string ext, IEnumerable<string> sources, IEnumerable<string> refs)
result = iCompilerCache.Remove(ext, sources, refs)

Removes a cached assembly based on extension, sources, and references.

ext
The file extension used in key generation.
sources
The source code files.
refs
The referenced assemblies.

戻り値: true if the assembly was removed; otherwise, false.

TryGet
public bool TryGet(string ext, IEnumerable<string> sources, IEnumerable<string> refs, Byte[] assembly)
result = iCompilerCache.TryGet(ext, sources, refs, assembly)

Tries to retrieve a cached assembly based on extension, sources, and references.

ext
The file extension used in key generation.
sources
The source code files.
refs
The referenced assemblies.
assembly
When this method returns, contains the cached assembly if found; otherwise, null.

戻り値: true if the assembly was retrieved from the cache; otherwise, false.