C# Class Octopus.Client.Model.Versioning.VersionComparer

An IVersionComparer for NuGetVersion and NuGetVersion types.
Inheritance: IVersionComparer
Afficher le fichier Open project: OctopusDeploy/Octo.exe Class Usage Examples

Méthodes publiques

Свойство Type Description
Default IVersionComparer
Version IVersionComparer
VersionRelease IVersionComparer
VersionReleaseMetadata IVersionComparer

Méthodes publiques

Méthode Description
Compare ( StrictSemanticVersion x, StrictSemanticVersion y ) : int

Compare versions.

Compare ( StrictSemanticVersion version1, StrictSemanticVersion version2, VersionComparison versionComparison ) : int

Compares the given versions using the VersionComparison mode.

Equals ( StrictSemanticVersion x, StrictSemanticVersion y ) : bool

Determines if both versions are equal.

GetHashCode ( StrictSemanticVersion version ) : int

Gives a hash code based on the normalized version string.

VersionComparer ( ) : System

Creates a VersionComparer using the default mode.

VersionComparer ( VersionComparison versionComparison ) : System

Creates a VersionComparer that respects the given comparison mode.

Private Methods

Méthode Description
CompareLegacyVersion ( SemanticVersion legacyX, SemanticVersion legacyY ) : int

Compares the 4th digit of the version number.

CompareRelease ( string version1, string version2 ) : int

Release labels are compared as numbers if they are numeric, otherwise they will be compared as strings.

CompareReleaseLabels ( IEnumerable version1, IEnumerable version2 ) : int

Compares sets of release labels.

Method Details

Compare() public méthode

Compare versions.
public Compare ( StrictSemanticVersion x, StrictSemanticVersion y ) : int
x StrictSemanticVersion
y StrictSemanticVersion
Résultat int

Compare() public static méthode

Compares the given versions using the VersionComparison mode.
public static Compare ( StrictSemanticVersion version1, StrictSemanticVersion version2, VersionComparison versionComparison ) : int
version1 StrictSemanticVersion
version2 StrictSemanticVersion
versionComparison VersionComparison
Résultat int

Equals() public méthode

Determines if both versions are equal.
public Equals ( StrictSemanticVersion x, StrictSemanticVersion y ) : bool
x StrictSemanticVersion
y StrictSemanticVersion
Résultat bool

GetHashCode() public méthode

Gives a hash code based on the normalized version string.
public GetHashCode ( StrictSemanticVersion version ) : int
version StrictSemanticVersion
Résultat int

VersionComparer() public méthode

Creates a VersionComparer using the default mode.
public VersionComparer ( ) : System
Résultat System

VersionComparer() public méthode

Creates a VersionComparer that respects the given comparison mode.
public VersionComparer ( VersionComparison versionComparison ) : System
versionComparison VersionComparison comparison mode
Résultat System

Property Details

Default public_oe static_oe property

A default comparer that compares metadata as strings.
public static IVersionComparer Default
Résultat IVersionComparer

Version public_oe static_oe property

A comparer that uses only the version numbers.
public static IVersionComparer Version
Résultat IVersionComparer

VersionRelease public_oe static_oe property

Compares versions without comparing the metadata.
public static IVersionComparer VersionRelease
Résultat IVersionComparer

VersionReleaseMetadata public_oe static_oe property

A version comparer that follows SemVer 2.0.0 rules.
public static IVersionComparer VersionReleaseMetadata
Résultat IVersionComparer