VersionNumber
ReferencesRepresents 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.
Properties
MaxValidBuildBranch
#Represents the largest possible valid value of VersionNumber.BuildBranch. This field is read-only.
MinValidBuildBranch
#Represents the smallest possible valid value of VersionNumber.BuildBranch. This field is read-only.
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.
Returns: 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.
Returns: 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().)
Overrides: ValueType.ToString
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.
out VersionNumber
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)).
out VersionNumber
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.