Represents a version object, compliant with the Semantic Version standard 2.0 (http://semver.org).
public class SemanticVersion : IComparable, IComparable<SemanticVersion>, IEquatable<SemanticVersion>
SemanticVersion Parse(string input, bool looseMode = False)Summary: Construct a new semantic version from a version string.
Parameters:
input
- The version string.
looseMode
- When true, be more forgiving of some invalid version specifications.Returns: The SemanticVersion
bool TryParse(string input, out SemanticVersion result)Summary: Try to construct a new semantic version from a version string.
Parameters:
input
- The version string.
result
- The Version, or null when parse fails.Returns: A boolean indicating success of the parse operation.
bool TryParse(string input, bool looseMode, out SemanticVersion result)Summary: Try to construct a new semantic version from a version string.
Parameters:
input
- The version string.
result
- The Version, or null when parse fails.Returns: A boolean indicating success of the parse operation.
BuildSummary: The build string, or null for no build version.
IsPreReleaseSummary: Whether this version is a pre-release.
IsStrictModeSummary: Whether this version is a strict SemVer2.0.
MajorSummary: The major part of the version.
Remarks: Increment the major version part - when you make incompatible API changes.
MinorSummary: The minor part of the version.uu
Remarks: Increment the minor version part - when you add functionality in a backwards compatible manner.
PatchSummary: The patch part of the version.
Remarks: Increment the patch version part - when you make backwards compatible bug fixes.
PreReleaseSummary: The pre-release string, or null for no pre-release version.
SemanticVersion BaseVersion()Summary: Returns this version without any pre-release or build version.
Returns: The base version
int CompareTo(object obj)Summary: Compares two versions are semantically.
Parameters:
obj
- The other.
int CompareTo(SemanticVersion other)Summary: Compares two versions are semantically.
Parameters:
obj
- The other.
int CompareTo(SemanticVersion otherVersion, int significantParts, int startingPart, bool looseMode = False)Summary: Compares two versions are semantically.
Parameters:
obj
- The other.
bool Equals(SemanticVersion other)Summary: Test whether two versions are semantically equivalent.
Parameters:
other
- The other.
bool Equals(object obj)Summary: Test whether two versions are semantically equivalent.
Parameters:
other
- The other.
int GetHashCode()Summary: Calculate a hash code for the version.
bool GreaterThan(SemanticVersion otherVersion, int significantParts = 4, int startingPart = 1, bool looseMode = False)Summary: Greater than.
Parameters:
otherVersion
- The other version.
significantParts
- The significant parts.
startingPart
- The starting part.
looseMode
- if set to true [loose mode].
bool GreaterThanOrEqualTo(SemanticVersion otherVersion, int significantParts = 4, int startingPart = 1)Summary: Greater than or equal.
Parameters:
otherVersion
- The other version.
significantParts
- The significant parts.
startingPart
- The starting part.
bool IsNewerThan(SemanticVersion otherVersion, bool withinMinorReleaseOnly = False, bool looseMode = False)Summary: Is newer than.
Parameters:
otherVersion
- The other version.
withinMinorReleaseOnly
- if set to true [within minor release only].
looseMode
- if set to true [loose mode].
string ToString()
Version ToVersion()Summary: Converts to
System.Version
based on Major, Minor and Patch.