BaseCodeReference

Ecng.Compilation

Provides a base implementation for a code reference with persistence support.

Implementa: ICodeReference, IAsyncPersistable

Construtores

BaseCodeReference
protected BaseCodeReference(IFileSystem fileSystem)
baseCodeReference = BaseCodeReference(fileSystem)

Provides a base implementation for a code reference with persistence support.

fileSystem
File system abstraction to use.

Propriedades

FileSystem
public IFileSystem FileSystem { get; }
value = baseCodeReference.FileSystem

File system abstraction available to derived classes.

Id
public virtual string Id { get; }
value = baseCodeReference.Id

Gets the identifier of the code reference. Defaults to the location.

IsValid
public abstract bool IsValid { get; }
value = baseCodeReference.IsValid

Gets a value indicating whether the code reference is valid.

Location
public abstract string Location { get; }
value = baseCodeReference.Location

Gets the location of the code reference.

Name
public abstract string Name { get; }
value = baseCodeReference.Name

Gets the name of the code reference.

Métodos

GetImages
public abstract ValueTask<IEnumerable<ValueTuple<string, byte[]>>> GetImages(CancellationToken cancellationToken)
result = baseCodeReference.GetImages(cancellationToken)

Asynchronously retrieves the images associated with the code reference.

cancellationToken
The token to monitor for cancellation requests.

Retorna: A task that represents the asynchronous operation. The task result contains an enumerable of tuples with image name and image body.

LoadAsync
public abstract Task LoadAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = baseCodeReference.LoadAsync(storage, cancellationToken)

Loads the settings from the specified storage.

storage
The storage containing the settings.
cancellationToken
CancellationToken

Retorna: Task

SaveAsync
public abstract Task SaveAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = baseCodeReference.SaveAsync(storage, cancellationToken)

Saves the settings to the specified storage.

storage
The storage where the settings will be saved.
cancellationToken
CancellationToken

Retorna: Task

ToString
public override string ToString()
result = baseCodeReference.ToString()

Returns a string that represents the current code reference.

Retorna: The location of the code reference.