Zum Hauptinhalt springen

CkVersion

Namespace: Meshmakers.Octo.ConstructionKit.Contracts

Represents a construction kit element version

public struct CkVersion

Inheritance Object → ValueType → CkVersion
Implements IComparable<CkVersion>, IEquatable<CkVersion>

Properties​

Major​

Returns the major version

public int Major { get; }

Property Value​

Int32

Minor​

Returns the minor version

public int Minor { get; }

Property Value​

Int32

Revision​

Returns the revision

public int Revision { get; }

Property Value​

Int32

Constructors​

CkVersion(Int32, Int32, Int32)​

Creates a new instance of CkVersion from its parts

public CkVersion(int major, int minor, int revision)

Parameters​

major Int32
Major version, must not be negative

minor Int32
Minor version, must not be negative

revision Int32
Revision, must not be negative

Exceptions​

ArgumentOutOfRangeException

CkVersion(String)​

Creates a new instance of CkVersion

public CkVersion(string version)

Parameters​

version String
Version as string, e. g. 1.0.0

Exceptions​

ArgumentOutOfRangeException

Methods​

CompareTo(CkVersion)​

Compares this instance to another CkVersion instance

public int CompareTo(CkVersion other)

Parameters​

other CkVersion

Returns​

Int32

IsCompatible(CkVersion)​

public bool IsCompatible(CkVersion other)

Parameters​

other CkVersion

Returns​

Boolean

Bump(CkSemVerLevel)​

Returns the version that results from bumping this version by exactly one step of the given semantic version level. Bumping by CkSemVerLevel.None returns the version unchanged.

public CkVersion Bump(CkSemVerLevel level)

Parameters​

level CkSemVerLevel
The semantic version level to bump by

Returns​

CkVersion
The bumped version

Exceptions​

ArgumentOutOfRangeException
Thrown for unknown levels

IsAtLeastBumpOf(CkVersion, CkSemVerLevel)​

Returns true when this version is at least one bump of the given level above the baseline version. Higher versions than the exact bump are also accepted (minimum level semantics).

public bool IsAtLeastBumpOf(CkVersion baseline, CkSemVerLevel level)

Parameters​

baseline CkVersion
The baseline version the bump is measured against

level CkSemVerLevel
The required semantic version level

Returns​

Boolean
True when this version satisfies the minimum bump

Equals(CkVersion)​

public bool Equals(CkVersion other)

Parameters​

other CkVersion

Returns​

Boolean

ToString()​

Returns a string representation of the value.

public string ToString()

Returns​

String
A string representation of the value.

Equals(Object)​

public bool Equals(object obj)

Parameters​

obj Object

Returns​

Boolean

GetHashCode()​

public int GetHashCode()

Returns​

Int32