-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
area-System.Runtimecode-analyzerMarks an issue that suggests a Roslyn analyzerMarks an issue that suggests a Roslyn analyzer
Milestone
Description
We decided in #40111 (comment) to expose OS checks as static helpers on OperatingSystem. We need to implement those:
namespace System
{
public partial class OperatingSystem
{
// Primary
public static bool IsOSPlatform(string platform);
public static bool IsOSPlatformVersionAtLeast(string platform, int major, int minor = 0, int build = 0, int revision = 0);
// Accelerators for platforms where versions don't make sense
public static bool IsBrowser();
public static bool IsLinux();
// Accelerators with version checks
public static bool IsFreeBSD();
public static bool IsFreeBSDVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0);
public static bool IsAndroid();
public static bool IsAndroidVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0);
public static bool IsIOS();
public static bool IsIOSVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0);
public static bool IsMacOS();
public static bool IsMacOSVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0);
public static bool IsTvOS();
public static bool IsTvOSVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0);
public static bool IsWatchOS();
public static bool IsWatchOSVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0);
public static bool IsWindows();
public static bool IsWindowsVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0);
}
}/cc @jeffhandley @buyaa-n
Metadata
Metadata
Assignees
Labels
area-System.Runtimecode-analyzerMarks an issue that suggests a Roslyn analyzerMarks an issue that suggests a Roslyn analyzer