Zero Install .NET API 2.20.0
ZeroInstall.Model.Command Class Reference

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

Inheritance diagram for ZeroInstall.Model.Command:
ZeroInstall.Model.FeedElement ZeroInstall.Model.IArgBaseContainer ZeroInstall.Model.IBindingContainer ZeroInstall.Model.IDependencyContainer NanoByte.Common.ICloneable< Command > ZeroInstall.Model.XmlUnknown

Public Member Functions

virtual void Normalize ()
 Converts legacy elements, sets default values, etc.. More...
 
override string ToString ()
 Returns the Command in the form "Name (Path)". Not safe for parsing!
 
Command Clone ()
 Creates a deep copy of this Command instance. More...
 
bool Equals (Command? other)
 
override bool Equals (object? obj)
 
override int GetHashCode ()
 
- Public Member Functions inherited from ZeroInstall.Model.FeedElement
override int GetHashCode ()
 
- Public Member Functions inherited from ZeroInstall.Model.XmlUnknown
string ToShortXml ()
 Returns a shortened XML representation (with attributes but without child elements). More...
 
override int GetHashCode ()
 
- Public Member Functions inherited from NanoByte.Common.ICloneable< Command >
Command Clone ()
 

Static Public Attributes

const string NameRun = "run"
 Canonical Name corresponding to Element.Main.
 
const string NameRunGui = "run-gui"
 Conventional Name for GUI-only versions of applications.
 
const string NameTest = "test"
 Canonical Name corresponding to Element.SelfTest.
 
const string NameCompile = "compile"
 Canonical Name used by 0compile.
 

Properties

string Name = default! [getset]
 The name of the command. Well-known names are NameRun, NameTest and NameCompile.
 
string? Path [getset]
 The relative path of an executable inside the implementation that should be executed to run this command.
 
List< ArgBaseArguments = new() [get]
 A list of command-line arguments to be passed to an implementation executable.
 
List< BindingBindings = new() [get]
 A list of Bindings for Implementations to locate Dependencys.
 
WorkingDirWorkingDir [getset]
 Switches the working directory of a process on startup to a location within an implementation.
 
List< DependencyDependencies = new() [get]
 A list of interfaces this command depends upon.
 
List< RestrictionRestrictions = new() [get]
 A list of interfaces that are restricted to specific versions when used.
 
RunnerRunner [getset]
 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.
 
- Properties inherited from ZeroInstall.Model.FeedElement
VersionRangeIfZeroInstallVersion [getset]
 Only process this element if the current Zero Install version matches the range.
 
string??? IfZeroInstallVersionString [getset]
 Used for XML serialization. More...
 
- Properties inherited from ZeroInstall.Model.IArgBaseContainer
List< ArgBaseArguments [get]
 A list of command-line arguments to be passed to an executable.
 
- Properties inherited from ZeroInstall.Model.IBindingContainer
List< BindingBindings [get]
 A list of Bindings for Implementations to locate Dependencys.
 
- Properties inherited from ZeroInstall.Model.IDependencyContainer
List< DependencyDependencies [get]
 A list of interfaces this implementation depends upon.
 
List< RestrictionRestrictions [get]
 A list of interfaces that are restricted to specific versions when used.
 

Additional Inherited Members

- Public Attributes inherited from ZeroInstall.Model.XmlUnknown
XmlAttribute?[] UnknownAttributes
 Contains any unknown additional XML attributes.
 
XmlElement?[] UnknownElements
 Contains any unknown additional XML elements.
 
- Protected Member Functions inherited from ZeroInstall.Model.FeedElement
bool Equals (FeedElement? other)
 
- Protected Member Functions inherited from ZeroInstall.Model.XmlUnknown
void EnsureAttribute (object? value, string attributeName)
 Ensures that a value deserialized from an XML attribute is set (not null). More...
 
void EnsureAttributeSafeID (string? value, string attributeName)
 Ensures that a value deserialized from an XML attribute is set (not null) and only contains alphanumeric characters, spaces ( ), dots (.), underscores (_), hyphens (-) and plus signs (+). More...
 
bool Equals (XmlUnknown? other)
 
- Static Protected Member Functions inherited from ZeroInstall.Model.FeedElement
static bool FilterMismatch (IRecipeStep step)
 Checks whether an element passes the specified IfZeroInstallVersion restriction, if any.
 
- Static Package Functions inherited from ZeroInstall.Model.FeedElement
static bool FilterMismatch< T > (T element)
 Checks whether an element passes the specified IfZeroInstallVersion restriction, if any. More...
 

Detailed Description

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

See also
Element.Commands

Member Function Documentation

◆ Clone()

Command ZeroInstall.Model.Command.Clone ( )
inline

Creates a deep copy of this Command instance.

Returns
The new copy of the Command.

◆ Normalize()

virtual void ZeroInstall.Model.Command.Normalize ( )
inlinevirtual

Converts legacy elements, sets default values, etc..

Exceptions
InvalidDataExceptionA required property is not set or invalid.

The documentation for this class was generated from the following file: