Table of Contents

Class BaseCodeReference

Namespace
Ecng.Compilation
Assembly
Ecng.Compilation.dll

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

public abstract class BaseCodeReference : ICodeReference, IPersistable
Inheritance
BaseCodeReference
Implements
Derived
Inherited Members
Extension Methods

Constructors

BaseCodeReference()

protected BaseCodeReference()

Properties

Id

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

public virtual string Id { get; }

Property Value

string

IsValid

Gets a value indicating whether the code reference is valid.

public abstract bool IsValid { get; }

Property Value

bool

Location

Gets the location of the code reference.

public abstract string Location { get; }

Property Value

string

Name

Gets the name of the code reference.

public abstract string Name { get; }

Property Value

string

Methods

GetImages(CancellationToken)

Asynchronously retrieves the images associated with the code reference.

public abstract ValueTask<IEnumerable<(string name, byte[] body)>> GetImages(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask<IEnumerable<(string name, byte[] body)>>

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

Load(SettingsStorage)

Loads the settings from the specified storage.

public abstract void Load(SettingsStorage storage)

Parameters

storage SettingsStorage

The storage containing the settings.

Save(SettingsStorage)

Saves the settings to the specified storage.

public abstract void Save(SettingsStorage storage)

Parameters

storage SettingsStorage

The storage where the settings will be saved.

ToString()

Returns a string that represents the current code reference.

public override string ToString()

Returns

string

The location of the code reference.