Table of Contents

Class Verb

Namespace
ZeroInstall.Model.Capabilities
Assembly
ZeroInstall.Model.dll

The mapping of an action/verb (e.g. open, edit) to a Command.

[Serializable]
[Equatable]
public sealed class Verb : XmlUnknown, IEquatable<XmlUnknown>, IDescriptionContainer, ICloneable<Verb>, IEquatable<Verb>
Inheritance
Verb
Implements
Inherited Members

Fields

NameEdit

Canonical Name for opening a file in editing mode.

public const string NameEdit = "edit"

Field Value

string

NameOpen

Canonical Name for opening a file.

public const string NameOpen = "open"

Field Value

string

NameOpenAs

Canonical Name for opening a file in an application of the user's choice.

public const string NameOpenAs = "openas"

Field Value

string

NameOpenNew

Canonical Name for opening a file in a new window.

public const string NameOpenNew = "opennew"

Field Value

string

NamePlay

Canonical Name for opening a media file and starting playback immediately.

public const string NamePlay = "play"

Field Value

string

NamePreview

Canonical Name for displaying a quick, simple response that allows the user to rapidly preview and dismiss items.

public const string NamePreview = "Preview"

Field Value

string

NamePrint

Canonical Name for printing a file while displaying as little as necessary to complete the task.

public const string NamePrint = "print"

Field Value

string

Properties

Arguments

Command-line arguments to be passed to the command. Will be automatically escaped to allow proper concatenation of multiple arguments containing spaces. "${item}" gets replaced with the path of the file being opened.

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

Property Value

List<Arg>

ArgumentsLiteral

Command-line arguments to be passed to the command in escaped form. "%V" gets replaced with the path of the file being opened. This is ignored if Arguments has elements.

public string? ArgumentsLiteral { get; set; }

Property Value

string

Command

The name of the command in the Feed to use when launching via this capability; leave null for NameRun.

[TypeConverter(typeof(CommandNameConverter))]
public string? Command { get; set; }

Property Value

string

Descriptions

Full descriptions for different languages, which can be several paragraphs long.

[Browsable(false)]
[OrderedEquality]
public LocalizableStringCollection Descriptions { get; }

Property Value

LocalizableStringCollection

Extended

Set this to true to hide the verb in the Windows context menu unless the Shift key is pressed when opening the menu.

public bool Extended { get; set; }

Property Value

bool

Name

The name of the verb. Must be an alphanumeric string. Use canonical names to get automatic localization; specify Descriptions otherwise.

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

Property Value

string

SingleElementOnly

Set this to true to hide the verb if more than one element is selected.

public bool SingleElementOnly { get; set; }

Property Value

bool

Remarks

Use this to help avoid running out of resources if the user opens too many files.

Methods

Clone()

Creates a deep copy of this Verb instance.

public Verb Clone()

Returns

Verb

The new copy of the Verb.

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.

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 void Normalize()

Exceptions

InvalidDataException

A required property is not set or invalid.

ToString()

Returns the extension in the form "Name = Command". Not safe for parsing!

public override string ToString()

Returns

string

Operators

operator ==(Verb?, Verb?)

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

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

Parameters

left Verb

The left object

right Verb

The right object

Returns

bool

true if the objects are equal; otherwise, false.

operator !=(Verb?, Verb?)

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

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

Parameters

left Verb

The left object

right Verb

The right object

Returns

bool

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