Skip to content

Commit

Permalink
Merge pull request #37 from novotnyllc/rc1
Browse files Browse the repository at this point in the history
Rc1
  • Loading branch information
clairernovotny authored Sep 15, 2020
2 parents d16f21e + 2385c4e commit 9032ea7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
9 changes: 7 additions & 2 deletions OSVersionHelper/Windows10Release.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ public enum Windows10Release
/// <summary>
/// 10.0.19041.0 (20H01)
/// </summary>
May2020 = 2004

May2020 = 2004,

/// <summary>
/// 10.0.19042.0 (20H02)
/// </summary>
September2020 = 2009

}
}
17 changes: 16 additions & 1 deletion OSVersionHelper/WindowsVersionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
using Windows.Foundation.Metadata;
using Windows.Security.EnterpriseData;


#if NET5_0
using System.Runtime.Versioning;
[assembly: SupportedOSPlatform("windows")]
#endif

namespace OSVersionHelper
{
public static class WindowsVersionHelper
Expand All @@ -23,7 +29,10 @@ static WindowsVersionHelper()
{
if (IsSince(WindowsVersions.Win10))
{
if (IsApiContractPresent(10))
if (IsApiContractPresent(11))
{
Windows10Release = Windows10Release.September2020;
} else if (IsApiContractPresent(10))
{
Windows10Release = Windows10Release.May2020;
}
Expand Down Expand Up @@ -76,6 +85,12 @@ static WindowsVersionHelper()

public static bool IsWindows10 { get; } = IsWindowsNt && IsSince(WindowsVersions.Win10);


/// <summary>
/// Gets a value indicating whether the current OS is Windows 10 September 2020 Update (20H02) or greater
/// </summary>
public static bool IsWindows10September2020OrGreater => IsWindows10 && Windows10Release >= Windows10Release.September2020;

/// <summary>
/// Gets a value indicating whether the current OS is Windows 10 May 2020 Update (20H01) or greater
/// </summary>
Expand Down

0 comments on commit 9032ea7

Please sign in to comment.