logo
logo

Class FileVersion

Represents the file version of an assembly

Constructors

FileVersion()

Declaration
new FileVersion()

Functions

parse(fileVersion)

Parses a file version string (format: <major>.<minor>.<patch>.<revision>) to an instance.

Declaration
function parse(fileVersion)
Parameters
Type Name Description
fileVersion

The file version string to parse

Returns
Type Description

A file version instance.

tryParse(fileVersion, defaultValue)

Tries to parse a file version string (see parse(fileVersion)) and returns null or the specified default value when it fails.

Declaration
function tryParse(fileVersion, defaultValue)
Parameters
Type Name Description
fileVersion

The file version string to parse

defaultValue

The value to return when parsing fails

Returns
Type Description

A file version instance or null.

smallerThan(otherVersion)

Compares if the current instance is smaller than the specified version.

Declaration
function smallerThan(otherVersion)
Parameters
Type Name Description
otherVersion

The version to compare the current instance to

Returns
Type Description

A boolean with the result.

smallerThanOrEqual(otherVersion)

Compares if the current instance is smaller or equal than the specified version.

Declaration
function smallerThanOrEqual(otherVersion)
Parameters
Type Name Description
otherVersion

The version to compare the current instance to

Returns
Type Description

A boolean with the result.

greaterThan(otherVersion)

Compares if the current instance is greater than the specified version.

Declaration
function greaterThan(otherVersion)
Parameters
Type Name Description
otherVersion

The version to compare the current instance to

Returns
Type Description

A boolean with the result.

greaterThanOrEqual(otherVersion)

Compares if the current instance is greater or equal than the specified version.

Declaration
function greaterThanOrEqual(otherVersion)
Parameters
Type Name Description
otherVersion

The version to compare the current instance to

Returns
Type Description

A boolean with the result.

equals(otherVersion)

Compares if the current instance equals (by values) the specified file.

Declaration
function equals(otherVersion)
Parameters
Type Name Description
otherVersion

The version to compare the current instance to

Returns
Type Description

A boolean with the result.

compareTo(otherVersion)

Compare the current instance with the specified file.

Declaration
function compareTo(otherVersion)
Parameters
Type Name Description
otherVersion

The version to compare the current instance to

Returns
Type Description

0 when the versions are equal,. 1 when the current instance is greater, -1 when the current instance is smaller

toString()

Gets the file version string representation for this instance.

Declaration
function toString()

Can we improve this article ? Provide feedback