Class Command
A command says how to run an Implementation as a program.
Implements
Inherited Members
Namespace: ZeroInstall.Model
Assembly: ZeroInstall.Model.dll
Syntax
public class Command : FeedElement, IArgBaseContainer, IBindingContainer, IDependencyContainer
Constructors
Command()
Declaration
public Command()
Fields
NameCompile
Canonical Name used by 0compile.
Declaration
public const string NameCompile = "compile"
Field Value
Type | Description |
---|---|
String |
NameRun
Declaration
public const string NameRun = "run"
Field Value
Type | Description |
---|---|
String |
NameRunGui
Conventional Name for GUI-only versions of applications.
Declaration
public const string NameRunGui = "run-gui"
Field Value
Type | Description |
---|---|
String |
NameTest
Declaration
public const string NameTest = "test"
Field Value
Type | Description |
---|---|
String |
Properties
Arguments
A list of command-line arguments to be passed to an implementation executable.
Declaration
public List<ArgBase> Arguments { get; }
Property Value
Type | Description |
---|---|
List<ArgBase> |
Bindings
A list of Bindings for Implementations to locate Dependencys.
Declaration
public List<Binding> Bindings { get; }
Property Value
Type | Description |
---|---|
List<Binding> |
Dependencies
A list of interfaces this command depends upon.
Declaration
public List<Dependency> Dependencies { get; }
Property Value
Type | Description |
---|---|
List<Dependency> |
Name
The name of the command. Well-known names are NameRun, NameTest and NameCompile.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
String |
Path
The relative path of an executable inside the implementation that should be executed to run this command.
Declaration
public string Path { get; set; }
Property Value
Type | Description |
---|---|
String |
Restrictions
A list of interfaces that are restricted to specific versions when used.
Declaration
public List<Restriction> Restrictions { get; }
Property Value
Type | Description |
---|---|
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.
Declaration
public Runner Runner { get; set; }
Property Value
Type | Description |
---|---|
Runner |
WorkingDir
Switches the working directory of a process on startup to a location within an implementation.
Declaration
public WorkingDir WorkingDir { get; set; }
Property Value
Type | Description |
---|---|
WorkingDir |
Methods
Clone()
Creates a deep copy of this Command instance.
Declaration
public Command Clone()
Returns
Type | Description |
---|---|
Command | The new copy of the Command. |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
Equals(Command)
Declaration
public bool Equals(Command other)
Parameters
Type | Name | Description |
---|---|---|
Command | other |
Returns
Type | Description |
---|---|
Boolean |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
Normalize()
Converts legacy elements, sets default values, etc..
Declaration
public virtual void Normalize()
Exceptions
Type | Condition |
---|---|
InvalidDataException | A required property is not set or invalid. |
ToString()
Returns the Command in the form "Name (Path)". Not safe for parsing!
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Operators
Equality(Command, Command)
Indicates whether the object on the left is equal to the object on the right.
Declaration
public static bool operator ==(Command left, Command right)
Parameters
Type | Name | Description |
---|---|---|
Command | left | The left object |
Command | right | The right object |
Returns
Type | Description |
---|---|
Boolean | true if the objects are equal; otherwise, false. |
Inequality(Command, Command)
Indicates whether the object on the left is not equal to the object on the right.
Declaration
public static bool operator !=(Command left, Command right)
Parameters
Type | Name | Description |
---|---|---|
Command | left | The left object |
Command | right | The right object |
Returns
Type | Description |
---|---|
Boolean | true if the objects are not equal; otherwise, false. |