BaseCodeReference
Provides a base implementation for a code reference with persistence support.
Implementiert: ICodeReference, IAsyncPersistable
Konstruktoren
protected BaseCodeReference(IFileSystem fileSystem)
baseCodeReference = BaseCodeReference(fileSystem)
Provides a base implementation for a code reference with persistence support.
- fileSystem
- File system abstraction to use.
Eigenschaften
public IFileSystem FileSystem { get; }
value = baseCodeReference.FileSystem
File system abstraction available to derived classes.
public virtual string Id { get; }
value = baseCodeReference.Id
Gets the identifier of the code reference. Defaults to the location.
public abstract bool IsValid { get; }
value = baseCodeReference.IsValid
Gets a value indicating whether the code reference is valid.
public abstract string Location { get; }
value = baseCodeReference.Location
Gets the location of the code reference.
public abstract string Name { get; }
value = baseCodeReference.Name
Gets the name of the code reference.
Methoden
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.
Rückgabe: A task that represents the asynchronous operation. The task result contains an enumerable of tuples with image name and image body.
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
Rückgabe: Task
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
Rückgabe: Task
public override string ToString()
result = baseCodeReference.ToString()
Returns a string that represents the current code reference.
Rückgabe: The location of the code reference.