Skip to content

Commit

Permalink
fix: Fixed issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Jul 4, 2024
1 parent f6edbfa commit f7c5e12
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"rollForward": "latestMajor",
"allowPrerelease": false
}
}
2 changes: 1 addition & 1 deletion src/libs/H.InputSimulator/H.InputSimulator.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net4.5.1;netstandard2.0;netstandard1.1;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net4.5.1;netstandard2.0;netstandard1.1;net6.0;net8.0</TargetFrameworks>
<RootNamespace>WindowsInput</RootNamespace>
<NoWarn>$(NoWarn);CA1707;CA1720;CA1712;CA1069;CA5392</NoWarn>
<NoWarn>$(NoWarn);IDE0190</NoWarn>
Expand Down
3 changes: 2 additions & 1 deletion src/libs/H.InputSimulator/KeyboardSimulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ public IKeyboardSimulator ModifiedKeyStroke(
public IKeyboardSimulator TextEntry(string? text)
{
// If the text is NULL or an empty string, nothing is done instead of throwing an exception.
if (string.IsNullOrEmpty(text))
if (text == null ||
string.IsNullOrEmpty(text))
{
return this;
}
Expand Down
5 changes: 1 addition & 4 deletions src/libs/H.InputSimulator/WindowsInputMessageDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ internal class WindowsInputMessageDispatcher : IInputMessageDispatcher
/// <exception cref="Exception">If the any of the commands in the <paramref name="inputs"/> array could not be sent successfully.</exception>
public unsafe void DispatchInput(INPUT[] inputs)
{
if (inputs == null)
{
throw new ArgumentNullException(nameof(inputs));
}
inputs = inputs ?? throw new ArgumentNullException(nameof(inputs));
if (inputs.Length == 0)
{
throw new ArgumentException("The input array was empty", nameof(inputs));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net4.8;net6.0-windows</TargetFrameworks>
<TargetFrameworks>net4.8;net8.0-windows</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Net.Http;

namespace WindowsInput.Tests.UnicodeText;

[TestFixture]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0-windows;net4.8</TargetFrameworks>
<TargetFrameworks>net8.0-windows;net4.8</TargetFrameworks>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>

Expand Down

0 comments on commit f7c5e12

Please sign in to comment.