Skip to content

Struct PackageVersion

Namespace: Apogee.Content.Packages
Assembly: Apogee.Content.dll

A version as major.minor.patch: 1.2 is 1.2.0, a leading v and any -suffix or +build are ignored.

public readonly record struct PackageVersion : IComparable<PackageVersion>, IEquatable<PackageVersion>

Implements

IComparable<PackageVersion>, IEquatable<PackageVersion>

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

PackageVersion(int, int, int)

A version as major.minor.patch: 1.2 is 1.2.0, a leading v and any -suffix or +build are ignored.

public PackageVersion(int Major, int Minor, int Patch)

Parameters

Major int

Minor int

Patch int

Properties

Major

public int Major { get; init; }

Property Value

int

Minor

public int Minor { get; init; }

Property Value

int

Patch

public int Patch { get; init; }

Property Value

int

Methods

CompareTo(PackageVersion)

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(PackageVersion other)

Parameters

other PackageVersion

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.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

TryParse(string, out PackageVersion)

public static bool TryParse(string text, out PackageVersion version)

Parameters

text string

version PackageVersion

Returns

bool

Operators

operator >(PackageVersion, PackageVersion)

public static bool operator >(PackageVersion a, PackageVersion b)

Parameters

a PackageVersion

b PackageVersion

Returns

bool

operator >=(PackageVersion, PackageVersion)

public static bool operator >=(PackageVersion a, PackageVersion b)

Parameters

a PackageVersion

b PackageVersion

Returns

bool

operator <(PackageVersion, PackageVersion)

public static bool operator <(PackageVersion a, PackageVersion b)

Parameters

a PackageVersion

b PackageVersion

Returns

bool

operator <=(PackageVersion, PackageVersion)

public static bool operator <=(PackageVersion a, PackageVersion b)

Parameters

a PackageVersion

b PackageVersion

Returns

bool