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
NameRun
public const string NameRun = "run"
Field Value
NameRunGui
Conventional Name for GUI-only versions of applications.
public const string NameRunGui = "run-gui"
Field Value
NameTest
public const string NameTest = "test"
Field Value
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
Bindings
A list of Bindings for Implementations to locate Dependencys.
[Browsable(false)]
[OrderedEquality]
public List<Binding> Bindings { get; }
Property Value
Dependencies
A list of interfaces this command depends upon.
[Browsable(false)]
[OrderedEquality]
public List<Dependency> Dependencies { get; }
Property Value
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
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
Restrictions
A list of interfaces that are restricted to specific versions when used.
[Browsable(false)]
[OrderedEquality]
public List<Restriction> Restrictions { get; }
Property Value
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
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
Methods
Clone()
Creates a deep copy of this Command instance.
public Command Clone()
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
Equals(Command?)
protected bool Equals(Command? other)
Parameters
other
Command
Returns
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
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
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
Returns
- bool
true if the objects are not equal; otherwise, false.