Table of Contents

Class ImplementationExtensions

Namespace
ZeroInstall.Publish
Assembly
ZeroInstall.Publish.dll

Helpers for setting missing properties on Implementations.

public static class ImplementationExtensions
Inheritance
object
ImplementationExtensions

Methods

AddArchive(Implementation, Uri, string?, string?, IEnumerable<ManifestFormat>?, ICommandExecutor, ITaskHandler)

Adds an Archive to the implementation and sets its ManifestDigest and ID accordingly.

public static void AddArchive(this Implementation implementation, Uri href, string? localPath, string? extract, IEnumerable<ManifestFormat>? formats, ICommandExecutor executor, ITaskHandler handler)

Parameters

implementation Implementation

The implementation.

href Uri

The URL the archive can be downloaded from.

localPath string

A local copy of the archive; null to look for a file named like href in the current directory.

extract string

The subdirectory of the archive to extract; null for entire archive.

formats IEnumerable<ManifestFormat>

The manifest formats to calculate digests for. Leave empty for default.

executor ICommandExecutor

Used to modify properties in an undoable fashion.

handler ITaskHandler

A callback object used when the user is to be informed about progress.

Exceptions

OperationCanceledException

The user canceled the task.

FileNotFoundException

No local copy of the archive could be found.

IOException

A problem occurred while extracting the archive.

NotSupportedException

The archive type could not be determined.

DigestMismatchException

An existing digest does not match the newly calculated one.

AddDigest(Implementation, ManifestFormat, IImplementationStore, ICommandExecutor, ITaskHandler)

Adds a digest in an additional ManifestFormat to the implementation, using a cached copy of the implementation.

public static bool AddDigest(this Implementation implementation, ManifestFormat format, IImplementationStore implementationStore, ICommandExecutor executor, ITaskHandler handler)

Parameters

implementation Implementation

The implementation.

format ManifestFormat

The manifest format to add a digest for.

implementationStore IImplementationStore

Used to look for a cached copy of the implementation.

executor ICommandExecutor

Used to modify properties in an undoable fashion.

handler ITaskHandler

A callback object used when the user is to be informed about progress.

Returns

bool

true if a digest was added; false if the digest was already present or no cached copy was found.

Exceptions

OperationCanceledException

The user canceled the task.

IOException

A problem occurred while reading the cached implementation.

DigestMismatchException

The cached implementation does not match its expected digest.

SetMissing(Implementation, ICommandExecutor, ITaskHandler)

Sets missing properties on the implementation by downloading and inferring.

public static void SetMissing(this Implementation implementation, ICommandExecutor executor, ITaskHandler handler)

Parameters

implementation Implementation

The implementation.

executor ICommandExecutor

Used to modify properties in an undoable fashion.

handler ITaskHandler

A callback object used when the user is to be informed about progress.

Exceptions

OperationCanceledException

The user canceled the task.

WebException

A file could not be downloaded from the internet.

DigestMismatchException

An existing digest does not match the newly calculated one.