make some projects compatible with netframework4.8 again
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
using Pilz.Win32.Native;
|
||||
using Pilz.Win32.Native;
|
||||
using Keys = System.Windows.Forms.Keys;
|
||||
|
||||
namespace Pilz.Win32.Mapped;
|
||||
@@ -11,7 +9,7 @@ public class Keyboard
|
||||
|
||||
public static bool IsKeyDown(int keyCode)
|
||||
{
|
||||
return Conversions.ToDouble(User32.GetKeyState(keyCode).ToString() + 0x8000) < 0d;
|
||||
return Convert.ToDouble(User32.GetKeyState(keyCode).ToString() + 0x8000) < 0d;
|
||||
}
|
||||
|
||||
public static bool IsKeyDown(Keys keyCode)
|
||||
|
||||
@@ -8,8 +8,10 @@ public static class NativeTools
|
||||
[Obsolete("Use \"Environment.ProcessPath\" instead.")]
|
||||
public static string GetExecutablePath(bool checkRealOS = false)
|
||||
{
|
||||
#if NET8_0_OR_GREATER
|
||||
if (RuntimeInformationsEx.IsOSPlatform(OSType.Windows, checkRealOS))
|
||||
return Environment.ProcessPath;
|
||||
#endif
|
||||
return Process.GetCurrentProcess().MainModule.FileName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net8.0-windows</TargetFrameworks>
|
||||
<TargetFrameworks>net8.0-windows;netframework4.8</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<Version>2.1.0</Version>
|
||||
<Version>2.1.1</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>annotations</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
Reference in New Issue
Block a user