Table of Contents

Struct VersionPart

Namespace
ZeroInstall.Model
Assembly
ZeroInstall.Model.dll

Represents a part of a ImplementationVersion containing nothing, a VersionModifier, a DottedList or both.

[Serializable]
public readonly struct VersionPart : IEquatable<VersionPart>, IComparable<VersionPart>
Implements
Inherited Members

Constructors

VersionPart(VersionModifier, VersionDottedList)

Creates a new version part.

public VersionPart(VersionModifier modifier = VersionModifier.None, VersionDottedList dottedList = default)

Parameters

modifier VersionModifier

The optional modifier prefix.

dottedList VersionDottedList

The dotted list part.

Properties

DottedList

The dotted list part.

public VersionDottedList DottedList { get; }

Property Value

VersionDottedList

Modifier

The optional modifier prefix.

public VersionModifier Modifier { get; }

Property Value

VersionModifier

Methods

CompareTo(VersionPart)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(VersionPart other)

Parameters

other VersionPart

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

Equals(VersionPart)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(VersionPart other)

Parameters

other VersionPart

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Parse(string)

Parses a string into a version part.

public static VersionPart Parse(string value)

Parameters

value string

Returns

VersionPart

Exceptions

FormatException

value is not a valid version part.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(VersionPart, VersionPart)

public static bool operator ==(VersionPart left, VersionPart right)

Parameters

left VersionPart
right VersionPart

Returns

bool

operator >(VersionPart, VersionPart)

public static bool operator >(VersionPart left, VersionPart right)

Parameters

left VersionPart
right VersionPart

Returns

bool

operator >=(VersionPart, VersionPart)

public static bool operator >=(VersionPart left, VersionPart right)

Parameters

left VersionPart
right VersionPart

Returns

bool

operator !=(VersionPart, VersionPart)

public static bool operator !=(VersionPart left, VersionPart right)

Parameters

left VersionPart
right VersionPart

Returns

bool

operator <(VersionPart, VersionPart)

public static bool operator <(VersionPart left, VersionPart right)

Parameters

left VersionPart
right VersionPart

Returns

bool

operator <=(VersionPart, VersionPart)

public static bool operator <=(VersionPart left, VersionPart right)

Parameters

left VersionPart
right VersionPart

Returns

bool