C# Class NUnit.Framework.Internal.OSPlatform

Show file Open project: nunit/nunit Class Usage Examples

Public Properties

Property Type Description
MacOSXPlatformID PlatformID
UnixPlatformID_Microsoft PlatformID
UnixPlatformID_Mono PlatformID
XBoxPlatformID PlatformID

Public Methods

Method Description
OSPlatform ( PlatformID platform, System.Version version ) : Microsoft.Win32

Construct from a platform ID and version

OSPlatform ( PlatformID platform, System.Version version, ProductType product ) : Microsoft.Win32

Construct from a platform ID, version and product type

Private Methods

Method Description
CheckIfIsMacOSX ( PlatformID platform ) : bool
GetVersionEx ( OSVERSIONINFOEX &osvi ) : bool
GetWindows81PlusVersion ( System.Version version ) : System.Version

Gets the actual OS Version, not the incorrect value that might be returned for Win 8.1 and Win 10

If an application is not manifested as Windows 8.1 or Windows 10, the version returned from Environment.OSVersion will not be 6.3 and 10.0 respectively, but will be 6.2 and 6.3. The correct value can be found in the registry.

uname ( IntPtr buf ) : int

Method Details

OSPlatform() public method

Construct from a platform ID and version
public OSPlatform ( PlatformID platform, System.Version version ) : Microsoft.Win32
platform PlatformID
version System.Version
return Microsoft.Win32

OSPlatform() public method

Construct from a platform ID, version and product type
public OSPlatform ( PlatformID platform, System.Version version, ProductType product ) : Microsoft.Win32
platform PlatformID
version System.Version
product ProductType
return Microsoft.Win32

Property Details

MacOSXPlatformID public static property

Platform ID for MacOSX as defined by .NET and Mono
public static PlatformID MacOSXPlatformID
return PlatformID

UnixPlatformID_Microsoft public static property

Platform ID for Unix as defined by Microsoft .NET 2.0 and greater
public static PlatformID UnixPlatformID_Microsoft
return PlatformID

UnixPlatformID_Mono public static property

Platform ID for Unix as defined by Mono
public static PlatformID UnixPlatformID_Mono
return PlatformID

XBoxPlatformID public static property

Platform ID for XBox as defined by .NET and Mono
public static PlatformID XBoxPlatformID
return PlatformID