committed by
GitHub
6 changed files with 93 additions and 52 deletions
@ -0,0 +1,29 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Avalonia.Platform; |
|||
|
|||
namespace Avalonia.Direct2D1 |
|||
{ |
|||
class Direct2DChecker : IModuleEnvironmentChecker |
|||
{ |
|||
//Direct2D backend doesn't work on some machines anymore
|
|||
public bool IsCompatible |
|||
{ |
|||
get |
|||
{ |
|||
try |
|||
{ |
|||
Direct2D1Platform.InitializeDirect2D(); |
|||
return true; |
|||
} |
|||
catch |
|||
{ |
|||
return false; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -1,15 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Avalonia.Platform; |
|||
|
|||
namespace Avalonia.Direct2D1 |
|||
{ |
|||
class WindowsVersionChecker : IModuleEnvironmentChecker |
|||
{ |
|||
//Direct2D backend doesn't work with Win7 anymore
|
|||
public bool IsCompatible => Environment.OSVersion.Version >= new Version(6, 2); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue