Class PlatformHelper
PlatformHelper class is used by the PlatformAttribute class to determine whether a platform is supported.
public class PlatformHelper
- Inheritance
-
PlatformHelper
- Inherited Members
Constructors
PlatformHelper()
Default constructor uses the operating system and common language runtime of the system.
public PlatformHelper()
PlatformHelper(OSPlatform, RuntimeFramework)
Contruct a PlatformHelper for a particular operating system and common language runtime. Used in testing.
public PlatformHelper(OSPlatform os, RuntimeFramework rt)
Parameters
os
OSPlatformOperatingSystem to be used
rt
RuntimeFrameworkRuntimeFramework to be used
Fields
OSPlatforms
Comma-delimited list of all supported OS platform constants
public const string OSPlatforms = "Win,Win32,Win32S,Win32NT,Win32Windows,WinCE,Win95,Win98,WinMe,NT3,NT4,NT5,NT6,Win2008Server,Win2008ServerR2,Win2012Server,Win2012ServerR2,Win2K,WinXP,Win2003Server,Vista,Win7,Windows7,Win8,Windows8,Win8.1,Windows8.1,Unix,Linux,Xbox,MacOSX"
Field Value
RuntimePlatforms
Comma-delimited list of all supported Runtime platform constants
public static readonly string RuntimePlatforms
Field Value
Properties
Reason
Return the last failure reason. Results are not defined if called before IsSupported( Attribute ) is called.
public string Reason { get; }
Property Value
Methods
IsPlatformSupported(PlatformAttribute)
Tests to determine if the current platform is supported based on a platform attribute.
public bool IsPlatformSupported(PlatformAttribute platformAttribute)
Parameters
platformAttribute
PlatformAttributeThe attribute to examine
Returns
IsPlatformSupported(string)
Test to determine if the a particular platform or comma- delimited set of platforms is in use.
public bool IsPlatformSupported(string platform)
Parameters
platform
stringName of the platform or comma-separated list of platform ids
Returns
- bool
True if the platform is in use on the system
IsPlatformSupported(string[])
Test to determine if one of a collection of platforms is being used currently.
public bool IsPlatformSupported(string[] platforms)
Parameters
platforms
string[]