From 158356b3539f5f09d3baedb39a962449dd9018cc Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Thu, 15 Nov 2018 21:25:40 +0000 Subject: [PATCH] Add a static result to detect if the platform is Windows based. --- .idea/.idea.DiscImageChef/.idea/contentModel.xml | 1 - DiscImageChef.CommonTypes/Interop/DetectOS.cs | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.idea/.idea.DiscImageChef/.idea/contentModel.xml b/.idea/.idea.DiscImageChef/.idea/contentModel.xml index 7fbf5a66e..e113a4c9c 100644 --- a/.idea/.idea.DiscImageChef/.idea/contentModel.xml +++ b/.idea/.idea.DiscImageChef/.idea/contentModel.xml @@ -62,7 +62,6 @@ - diff --git a/DiscImageChef.CommonTypes/Interop/DetectOS.cs b/DiscImageChef.CommonTypes/Interop/DetectOS.cs index af2b86cb3..004e969f7 100644 --- a/DiscImageChef.CommonTypes/Interop/DetectOS.cs +++ b/DiscImageChef.CommonTypes/Interop/DetectOS.cs @@ -302,5 +302,10 @@ namespace DiscImageChef.CommonTypes.Interop [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string machine; } + + public static bool IsWindows => + GetRealPlatformID() == PlatformID.Win32NT || GetRealPlatformID() == PlatformID.Win32S || + GetRealPlatformID() == PlatformID.Win32Windows || GetRealPlatformID() == PlatformID.WinCE || + GetRealPlatformID() == PlatformID.WindowsPhone || GetRealPlatformID() == PlatformID.Xbox; } } \ No newline at end of file