VersionNumber

References
Represents a product version number that encodes major, minor, time and build branch information. as major.minor.yyddd.hhmmb where: yy = year of build - 2000 ddd = year day of build (1-366) hh = hour of build mm = minute of build b = branch of build

Constructors

VersionNumber

#
Initializes a new instance of the VersionNumber structure to the version specified by the parameters.
public VersionNumber(
major,
The major version number (0 through 63).
minor,
The minor version number (0 through 127).
time,
The time is the version time (January 1, 2000 00:00 through December 31 23:59). Seconds are ignored.
buildBranch
The branch used to build the product (developer, trunk, release_candidate, or release).
)

VersionNumber

#
Initializes a new instance of the VersionNumber structure to the version specified by the version quartet values.
public VersionNumber(
majorVersionNumber,
The major version number (0 through 63).
minorVersionNumber,
The minor version number (0 through 127)
versionQuartetYyddd,
The third version quartet value is (year - 2000)*1000 + yday, where year is 2000 to 2099 and yday is 1 to the number of days in the specified year.
versionQuartetHhmmb
The forth version quartet value is (hour*1000 + minute*10 + branch) where hour is 0 to 23, minute is 0 to 59, and branch is 0 to 3.
)

VersionNumber

#
Construct VersionNumber based on existing System.Version class.
public VersionNumber(
version
)

Properties

BuildBranch

#
Gets the build branch component of this instance.
public VersionNumber.Branch BuildBranch { get; }

IsValid

#
True when all information in the VersionNumber has valid values.
public bool IsValid { get; }

Major

#
Gets the major version number component of this instance.
public int Major { get; }

MaxMajorVersionNumber

#
The largest possible valid value of VersionNumber.MajorVersionNumber.
public static int MaxMajorVersionNumber { get; }

MaxMinorVersionNumber

#
The largest possible valid value of VersionNumber.MinorVersionNumber.
public static int MaxMinorVersionNumber { get; }

MaxValid

#
The largest possible valid VersionNumber.
public static VersionNumber MaxValid { get; }

MaxValidBuildBranch

#
Represents the largest possible valid value of VersionNumber.BuildBranch. This field is read-only.
public static VersionNumber.Branch MaxValidBuildBranch { get; }

MaxValidTime

#
The largest possible valid value of VersionNumber.Time. This field is read-only.
public static DateTime MaxValidTime { get; }

MinMajorVersionNumber

#
The smallest possible valid value of VersionNumber.MajorVersionNumber.
public static int MinMajorVersionNumber { get; }

MinMinorVersionNumber

#
The smallest possible valid value of VersionNumber.MinorVersionNumber.
public static int MinMinorVersionNumber { get; }

Minor

#
Gets the minor version number component of this instance.
public int Minor { get; }

MinValid

#
The smallest possible valid VersionNumber.
public static VersionNumber MinValid { get; }

MinValidBuildBranch

#
Represents the smallest possible valid value of VersionNumber.BuildBranch. This field is read-only.
public static VersionNumber.Branch MinValidBuildBranch { get; }

MinValidTime

#
The smallest possible valid value of VersionNumber.Time. This field is read-only.
public static DateTime MinValidTime { get; }

Time

#
Gets the version time component of this instance.
public DateTime Time { get; }

Unset

#
The Unset VersionNumber. VersionNumber.Unset.IsValid is false.
public static VersionNumber Unset { get; }

UnsetBuildBranch

#
The value of an Unset VersionNumber.BuildBranch.
public static VersionNumber.Branch UnsetBuildBranch { get; }

UnsetTime

#
The value of an Unset VersionNumber.Time.
public static DateTime UnsetTime { get; }

Methods

CompareTo

#
Compares the value of this instance to a specified VersionNumber value and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified VersionNumber value.
public int CompareTo(
value
The object to compare to the current instance.
)
A signed number indicating the relative values of this instance and the value parameter. Less than zero indicates this instance is earier than value. Zero indicates this instance is the same as value. Greater than zero indicates this instance is later than value.

CompareTo

#
Compares the value of this instance to a specified VersionNumber value and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified VersionNumber value.
public int CompareTo(
value
The object to compare to the current instance.
)
A signed number indicating the relative values of this instance and the value parameter. Less than zero indicates this instance is earier than value. Zero indicates this instance is the same as value. Greater than zero indicates this instance is later than value.

ToString

#
Converts the value of the current VersionNumber object to its equivalent string representation major.minor.yyddd.hhmmb. (Overrides ValueType.ToString().)
public override string ToString()

ToVersion

#
Convert this VersionNumber class to System.Version()
public Version ToVersion()

TryParse

#
Converts the specified string representation of a version number to its VersionNumber equivalent and returns a value that indicates whether the conversion succeeded.
public static bool TryParse(
s,
A string containing four integers separated by full stops in the format major.minor.yyddd.hhmmb, where yy is year-2000, ddd is the day of the year, hh is the hour, mm is the minute and b identifies the build branch.
result
When this method returns, result contains the VersionNumber value equivalent to the version number contained in s, if the conversion succeeded, or VersionNumber.Unset if the conversion failed. The conversion fails if the s parameter is null, is an empty string (""), or does not contain a valid string representation of version number. This parameter is passed uninitialized.
)

TryParse

#
Attempt so convert the System.Version representation of a version number to its VersionNumber equivalent and returns a value that indicates whether the conversion succeeded.
public static bool TryParse(
v,
A version number with quartet values (v.Major, v.Minor, v.Build, v.Revision) that are valid ((0 to 63),(0 to 127), (1 to 99365), (0 to 23593)).
result
When this method returns, result contains the VersionNumber value equivalent to the version number contained in v, if the conversion succeeded, or VersionNumber.Unset if the conversion failed. The conversion fails if the v parameter is null, is an empty string (""), or does not contain a valid string representation of version number. This parameter is passed uninitialized.
)