Table of Contents

Class Command

Namespace
ZeroInstall.Model
Assembly
ZeroInstall.Model.dll

A command says how to run an Implementation as a program.

[Serializable]
[Equatable]
public class Command : FeedElement, IEquatable<XmlUnknown>, IEquatable<FeedElement>, IArgBaseContainer, IBindingContainer, IDependencyContainer, ICloneable<Command>, IEquatable<Command>
Inheritance
Command
Implements
Inherited Members
Extension Methods

Fields

NameCompile

Canonical Name used by 0compile.

public const string NameCompile = "compile"

Field Value

string

NameRun

Canonical Name corresponding to Main.

public const string NameRun = "run"

Field Value

string

NameRunGui

Conventional Name for GUI-only versions of applications.

public const string NameRunGui = "run-gui"

Field Value

string

NameTest

Canonical Name corresponding to SelfTest.

public const string NameTest = "test"

Field Value

string

Properties

Arguments

A list of command-line arguments to be passed to an implementation executable.

[Browsable(false)]
[OrderedEquality]
public List<ArgBase> Arguments { get; }

Property Value

List<ArgBase>

Bindings

A list of Bindings for Implementations to locate Dependencys.

[Browsable(false)]
[OrderedEquality]
public List<Binding> Bindings { get; }

Property Value

List<Binding>

Dependencies

A list of interfaces this command depends upon.

[Browsable(false)]
[OrderedEquality]
public List<Dependency> Dependencies { get; }

Property Value

List<Dependency>

Name

The name of the command. Well-known names are NameRun, NameTest and NameCompile.

[TypeConverter(typeof(CommandNameConverter))]
public required string Name { get; set; }

Property Value

string

Path

The relative path of an executable inside the implementation that should be executed to run this command.

public string? Path { get; set; }

Property Value

string

Restrictions

A list of interfaces that are restricted to specific versions when used.

[Browsable(false)]
[OrderedEquality]
public List<Restriction> Restrictions { get; }

Property Value

List<Restriction>

Runner

A special kind of dependency: the program that is used to run this one. For example, a Python program might specify Python as its runner.

[Browsable(false)]
public Runner? Runner { get; set; }

Property Value

Runner

WorkingDir

Switches the working directory of a process on startup to a location within an implementation.

[Browsable(false)]
public WorkingDir? WorkingDir { get; set; }

Property Value

WorkingDir

Methods

Clone()

Creates a deep copy of this Command instance.

public Command Clone()

Returns

Command

The new copy of the Command.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Equals(Command?)

protected bool Equals(Command? other)

Parameters

other Command

Returns

bool

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Normalize()

Converts legacy elements, sets default values, etc..

public virtual void Normalize()

Exceptions

InvalidDataException

A required property is not set or invalid.

ToString()

Returns the Command in the form "Name (Path)". Not safe for parsing!

public override string ToString()

Returns

string

Operators

operator ==(Command?, Command?)

Indicates whether the object on the left is equal to the object on the right.

public static bool operator ==(Command? left, Command? right)

Parameters

left Command

The left object

right Command

The right object

Returns

bool

true if the objects are equal; otherwise, false.

operator !=(Command?, Command?)

Indicates whether the object on the left is not equal to the object on the right.

public static bool operator !=(Command? left, Command? right)

Parameters

left Command

The left object

right Command

The right object

Returns

bool

true if the objects are not equal; otherwise, false.

See Also