PlatformUtilitiesIsMinimumRequiredVersion Method

Tests whether the current platform version is at least equal to the supplied major and minor version numbers, returns false if this is not the case

Definition

Namespace: ASCOM.Com
Assembly: ASCOM.Com (in ASCOM.Com.dll) Version: 3.0.0-rc.1+86c25ce733aebb4d8b1b8a62e84770ea5e972bea
C#
public static bool IsMinimumRequiredVersion(
	int requiredMajorVersion,
	int requiredMinorVersion,
	int requiredServicePack,
	int requiredBuild
)

Parameters

requiredMajorVersion  Int32
The required major version number
requiredMinorVersion  Int32
The required minor version number. Use 0 if any minor version is acceptable.
requiredServicePack  Int32
The required service pack number. Use 0 if any service pack is acceptable.
requiredBuild  Int32
The required build number. Use 0 if any build number is acceptable

Return Value

Boolean
True if the current platform version equals or exceeds the version specified.

Remarks

This function provides a simple way to test for a minimum platform level. If for example, your application requires at least platform version 6.6.1.0 then you can use code such as this to make a test and display information as appropriate. if(!PlatformUtilities.IsMinimumRequiredVersion(6, 6, 1, 0) { // Abort, throw an exception, return an error etc. as appropriate. }

Exceptions

InvalidValueExceptionWhen any parameter value is outside the range implemented by the Platform.

Version Information

.NET Standard

Supported in: 2.0

See Also