initial
This commit is contained in:
87
libs/versionHelper.cs
Normal file
87
libs/versionHelper.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace C4IT_CustomerPanel.libs
|
||||
{
|
||||
public class VersionHelper
|
||||
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
|
||||
/// OS is at least Windows Vista
|
||||
|
||||
/// </summary>
|
||||
|
||||
public static bool IsAtLeastVista
|
||||
|
||||
{
|
||||
|
||||
get
|
||||
|
||||
{
|
||||
|
||||
if (Environment.OSVersion.Version.Major < 6)
|
||||
|
||||
{
|
||||
|
||||
Debug.WriteLine("How about trying this on Vista?");
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
/// OS is Windows 7 or higher
|
||||
|
||||
/// </summary>
|
||||
|
||||
public static bool IsWindows7orHigher
|
||||
|
||||
{
|
||||
|
||||
get
|
||||
|
||||
{
|
||||
|
||||
if (Environment.OSVersion.Version.Major == 6 &&
|
||||
|
||||
Environment.OSVersion.Version.Minor >= 1)
|
||||
|
||||
{
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
else if (Environment.OSVersion.Version.Major > 6)
|
||||
|
||||
{
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user