Table of Contents

Class Revision

Namespace
L5Sharp.Common
Assembly
L5Sharp.dll

Represents a revision number that is expressed by as {Major}.{Minor}.

public sealed class Revision : IComparable
Inheritance
Revision
Implements
Inherited Members

Constructors

Revision()

Creates a new default Revision with value 1.0.

public Revision()

Revision(double)

Creates a new Revision with the specified value.

public Revision(double value)

Parameters

value double

The double value representing the revision number.

Revision(string)

public Revision(string value)

Parameters

value string

Revision(ushort, ushort)

Creates a new Revision with the specified major and minor values.

public Revision(ushort major, ushort minor = 0)

Parameters

major ushort

The value of the major revision.

minor ushort

The value of the minor revision. Will default to 0 if not provided.

Properties

Major

The major revision of the Revision value.

public string Major { get; }

Property Value

string

Minor

The minor revision of the Revision value.

public string Minor { get; }

Property Value

string

Methods

CompareTo(object?)

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(object? obj)

Parameters

obj object

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 obj in the sort order.

Zero

This instance occurs in the same position in the sort order as obj.

Greater than zero

This instance follows obj in the sort order.

Exceptions

ArgumentException

obj is not the same type as this instance.

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.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Operators

operator ==(Revision, Revision)

Determines if the provided objects are equal.

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

Parameters

left Revision

An object to compare.

right Revision

An object to compare.

Returns

bool

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

operator >(Revision, Revision)

Compares two objects and determines if left is greater than right.

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

Parameters

left Revision

A Revision to compare.

right Revision

A Revision to compare.

Returns

bool

true if left is greater than right, otherwise, false.

operator >=(Revision, Revision)

Compares two objects and determines if left is greater than or equal to right.

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

Parameters

left Revision

A Revision to compare.

right Revision

A Revision to compare.

Returns

bool

true if left is greater than or equal to right, otherwise, false.

implicit operator string(Revision)

Converts a Revision to a string.

public static implicit operator string(Revision revision)

Parameters

revision Revision

The revision value to convert.

Returns

string

A new string value representing a major and minor revision.

implicit operator Revision(double)

Converts a string to a Revision.

public static implicit operator Revision(double revision)

Parameters

revision double

The revision value to convert.

Returns

Revision

A new Revision value representing a major and minor revision.

implicit operator Revision(string)

Converts a string to a Revision.

public static implicit operator Revision(string revision)

Parameters

revision string

The revision value to convert.

Returns

Revision

A new Revision value representing a major and minor revision.

operator !=(Revision, Revision)

Determines if the provided objects are not equal.

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

Parameters

left Revision

An object to compare.

right Revision

An object to compare.

Returns

bool

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

operator <(Revision, Revision)

Compares two objects and determines if left is less than right.

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

Parameters

left Revision

A Revision to compare.

right Revision

A Revision to compare.

Returns

bool

true if left is less than right, otherwise, false.

operator <=(Revision, Revision)

Compares two objects and determines if left is less than or equal to right.

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

Parameters

left Revision

A Revision to compare.

right Revision

A Revision to compare.

Returns

bool

true if left is less or equal to than right, otherwise, false.