Table of Contents

Class EnvironmentBinding

Namespace
ZeroInstall.Model
Assembly
ZeroInstall.Model.dll

Make a chosen Implementation available by setting environment variables.

[Serializable]
[Equatable]
public sealed class EnvironmentBinding : Binding, IEquatable<XmlUnknown>, IEquatable<FeedElement>, ICloneable<Binding>, IEquatable<EnvironmentBinding>
Inheritance
EnvironmentBinding
Implements
Inherited Members

Properties

Default

If the environment variable is not currently set then this value is used for prepending or appending.

public string? Default { get; set; }

Property Value

string

Insert

The relative path of the item within the implementation to insert into the variable value. Use . to publish the root directory.

public string? Insert { get; set; }

Property Value

string

Remarks

If this is set Value must be null.

Mode

Controls how the Insert or Value is added to the variable.

public EnvironmentMode Mode { get; set; }

Property Value

EnvironmentMode

Name

The name of the environment variable.

public required string Name { get; set; }

Property Value

string

Separator

Overrides the default separator character (":" on POSIX and ";" on Windows).

public string? Separator { get; set; }

Property Value

string

Value

A static value to set the variable to.

public string? Value { get; set; }

Property Value

string

Remarks

If this is set Insert must be null.

Methods

Clone()

Creates a deep copy of this EnvironmentBinding instance.

public override Binding Clone()

Returns

Binding

The new copy of the EnvironmentBinding.

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

Exceptions

InvalidDataException

A required property is not set or invalid.

ToString()

Returns the binding in the form "Name = Value (Mode, Default)". Not safe for parsing!

public override string ToString()

Returns

string

Operators

operator ==(EnvironmentBinding?, EnvironmentBinding?)

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

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

Parameters

left EnvironmentBinding

The left object

right EnvironmentBinding

The right object

Returns

bool

true if the objects are equal; otherwise, false.

operator !=(EnvironmentBinding?, EnvironmentBinding?)

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

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

Parameters

left EnvironmentBinding

The left object

right EnvironmentBinding

The right object

Returns

bool

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