Struct Version
Struct holding project version information.
Implements
System.IComparable
Assembly: Trimmer.dll
Syntax
[Serializable]
public struct Version : IComparable, IComparable<Version>, IEquatable<Version>
Constructors
|
Improve this Doc
View Source
Version(Int32, Int32, Int32, Int32, String, String)
Create a new version instance.
Declaration
public Version(int major, int minor, int patch, int build = 0, string commit = null, string branch = null)
Parameters
Type |
Name |
Description |
System.Int32 |
major |
|
System.Int32 |
minor |
|
System.Int32 |
patch |
|
System.Int32 |
build |
|
System.String |
commit |
|
System.String |
branch |
|
Fields
|
Improve this Doc
View Source
branch
An identifier for the versioned branch from which this version was created.
Declaration
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
build
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
commit
An identifier for the versioned commit from which this version was created.
Declaration
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
major
The major version of the project.
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
minor
The minor version of the project.
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
patch
The patch version of the project.
Declaration
Field Value
Type |
Description |
System.Int32 |
|
Properties
|
Improve this Doc
View Source
IsDefined
Check if this struct represents a valid version.
Declaration
public bool IsDefined { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
MajorMinor
Return the version as major.minor string (e.g. 1.2)
Declaration
public string MajorMinor { get; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
MajorMinorPatch
Return the version as major.minor.patch string (e.g. 1.2.3)
Declaration
public string MajorMinorPatch { get; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
MajorMinorPatchBuild
Return the version as major.minor.patch.build string (e.g. 1.2.3+4)
Declaration
public string MajorMinorPatchBuild { get; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
ProjectVersion
The main project version.
Declaration
public static Version ProjectVersion { get; set; }
Property Value
Methods
|
Improve this Doc
View Source
CompareTo(Version)
Declaration
public int CompareTo(Version other)
Parameters
Type |
Name |
Description |
Version |
other |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
CompareTo(Object)
Declaration
public int CompareTo(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Equals(Version)
Declaration
public bool Equals(Version other)
Parameters
Type |
Name |
Description |
Version |
other |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.ValueType.Equals(System.Object)
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.ValueType.GetHashCode()
|
Improve this Doc
View Source
Parse(String)
Parse a version string in the format "x.x.x".
Declaration
public static Version Parse(string input)
Parameters
Type |
Name |
Description |
System.String |
input |
|
Returns
|
Improve this Doc
View Source
Parse(String, out String)
Parse a version string in the format "x.x.x".
Declaration
public static Version Parse(string input, out string error)
Parameters
Type |
Name |
Description |
System.String |
input |
|
System.String |
error |
|
Returns
|
Improve this Doc
View Source
ToString()
Returns the version as a string in the form "major.minor.patch (build)"
(e.g. "1.2.3 (4)")
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.ValueType.ToString()
Operators
|
Improve this Doc
View Source
Equality(Version, Version)
Declaration
public static bool operator ==(Version lhs, Version rhs)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
GreaterThan(Version, Version)
Declaration
public static bool operator>(Version lhs, Version rhs)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
GreaterThanOrEqual(Version, Version)
Declaration
public static bool operator >=(Version lhs, Version rhs)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Inequality(Version, Version)
Declaration
public static bool operator !=(Version lhs, Version rhs)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
LessThan(Version, Version)
Declaration
public static bool operator <(Version lhs, Version rhs)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
LessThanOrEqual(Version, Version)
Declaration
public static bool operator <=(Version lhs, Version rhs)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IComparable
System.IComparable<T>
System.IEquatable<T>