//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// CommonHelpers satellite library | Author: Sergei Y.Kitáev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;

#if !WASM
namespace CommonHelpers {
#else
namespace CommonHelpers.WASM {
#endif

//**************************************************************************************************
partial class HOperatingSystem {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/// <exception cref="PlatformNotSupportedException" />
public static void Verify(OperatingSystem requiredMinimalOS)
{
   HArgChecking.VerifyNotNull( requiredMinimalOS );
   if (!CheckOperatingSystem( requiredMinimalOS ))
      throw new PlatformNotSupportedException(string.Format(
         NotSupportedInThisOSMessageFmt, GetNameOrVersionString( requiredMinimalOS ) ));
}

//==================================================================================================

/// <exception cref="PlatformNotSupportedException" />
public static void VerifyWindows81orLater() =>
   VerifyWindows81orLater( Environment.OSVersion );

/// <exception cref="PlatformNotSupportedException" />
public static void VerifyWindows8orLater() =>
   VerifyWindows8orLater( Environment.OSVersion );

/// <exception cref="PlatformNotSupportedException" />
public static void VerifyWindows7orLater() =>
   VerifyWindows7orLater( Environment.OSVersion );

/// <exception cref="PlatformNotSupportedException" />
public static void VerifyWindowsVistaOrLater() =>
   VerifyWindowsVistaOrLater( Environment.OSVersion );

/// <exception cref="PlatformNotSupportedException" />
public static void VerifyWindowsHP64BitOrLater() =>
   VerifyWindowsHP64BitOrLater( Environment.OSVersion );

/// <exception cref="PlatformNotSupportedException" />
public static void VerifyWindowsHPOrLater() =>
   VerifyWindowsHPOrLater( Environment.OSVersion );

/// <exception cref="PlatformNotSupportedException" />
public static void VerifyWindows2000orLater() =>
   VerifyWindows2000orLater( Environment.OSVersion );

//--------------------------------------------------------------------------------------------------

/// <exception cref="PlatformNotSupportedException" />
public static void VerifyWindows81orLater(OperatingSystem system) =>
   Verify( Windows81orServer2012R2 );

/// <exception cref="PlatformNotSupportedException" />
public static void VerifyWindows8orLater(OperatingSystem system) =>
   Verify( Windows8orServer2012 );

/// <exception cref="PlatformNotSupportedException" />
public static void VerifyWindows7orLater(OperatingSystem system) =>
   Verify( Windows7orServer2008R2 );

/// <exception cref="PlatformNotSupportedException" />
public static void VerifyWindowsVistaOrLater(OperatingSystem system) =>
   Verify( WindowsVistaOrServer2008 );

/// <exception cref="PlatformNotSupportedException" />
public static void VerifyWindowsHP64BitOrLater(OperatingSystem system) =>
   Verify( WindowsXP64BitOrServer2003orR2 );

/// <exception cref="PlatformNotSupportedException" />
public static void VerifyWindowsHPOrLater(OperatingSystem system) =>
   Verify( WindowsXP );

/// <exception cref="PlatformNotSupportedException" />
public static void VerifyWindows2000orLater(OperatingSystem system) =>
   Verify( Windows2000 );

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // HOperatingSystem
//**************************************************************************************************

} // CommonHelpers (.WASM)
