Click or drag to resize
SemanticVersion Class
Represents a Semantic Version, as described in http://semver.org/
Inheritance Hierarchy
SystemObject
  semver.toolsSemanticVersion

Namespace: semver.tools
Assembly: semver.tools (in semver.tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[SerializableAttribute]
[TypeConverterAttribute(typeof(SemanticVersionTypeConverter))]
public class SemanticVersion : IComparable, 
	IComparable<SemanticVersion>, IEquatable<SemanticVersion>

The SemanticVersion type exposes the following members.

Constructors
  NameDescription
Public methodSemanticVersion(Int32, Int32, Int32)
Constructs a SemanticVersion out of a Major, Minor and Patch number.
Public methodSemanticVersion(Int32, Int32, Int32, Int32)
Constructs a SemanticVersion out of a Major, Minor and Build version and a Revision. Use this when dealing with Microsoft style versions rather than true semantic versions.
Public methodSemanticVersion(Int32, Int32, Int32, String)
Constructs a SemanticVersion out of a Major, Minor and Patch number, and a pre release name.
Top
Methods
  NameDescription
Public methodCompareTo(Object)
Compares two SemanticVersions. Implements IComparable.CompareTo.
Public methodCompareTo(SemanticVersion)
Compares two SemanticVersions. Implements IComparable<SemanticVersion>.CompareTo.
Public methodEquals(Object)
Overrides Object.Equal. Returns true if the passed in obj is a SemanticVersion and equal (value wise) to this SemanticVersion.
(Overrides ObjectEquals(Object).)
Public methodEquals(SemanticVersion)
Implements IEquatable<SemanticVersion>.Equals. Returns true if the passed in SemanticVersion is equal value wise to this SemanticVersion.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Overrides Object.GetHashCode.
(Overrides ObjectGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStatic memberParse
Parses a string with a semantic version and returns the SemanticVersion. Exception if the string does not contain a valid semantic version.
Public methodStatic memberParseOptionalVersion
Attempts to parse a string with a semantic version.
Public methodToString
Returns the string that was originally used to create this SemanticVersion. If no string was used, returns a string representing this SemanticVersion.
(Overrides ObjectToString.)
Public methodStatic memberTryParse
Attempts to parse a string with a semantic version.
Public methodStatic memberTryParseNuGet
Parses a string using loose semantic versioning rules that allows a Microsoft or NuGet style version with 2-4 version components followed by an optional pre release name.
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Evalutes to true if version1 equals version2.
Public operatorStatic memberGreaterThan
Evalutes to true if version1 greater than version2.
Public operatorStatic memberGreaterThanOrEqual
Evalutes to true if version1 greater or equal to version2.
Public operatorStatic memberInequality
Evalutes to true if version1 does not equal version2.
Public operatorStatic memberLessThan
Evalutes to true if version1 smaller than version2.
Public operatorStatic memberLessThanOrEqual
Evalutes to true if version1 smaller or equal to version2.
Top
See Also