v3.0 Upgrade to .net9.0
This commit is contained in:
parent
318598f62a
commit
73c19a3f8f
@ -1,5 +1,6 @@
|
|||||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CGlax_005CRiderProjects_005CGlaxLogger_005CGlaxLogger_005Cbin_005CDebug_005Cnet7_002E0_005CGlaxLogger_002Edll/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CGlax_005CRiderProjects_005CGlaxLogger_005CGlaxLogger_005Cbin_005CDebug_005Cnet7_002E0_005CGlaxLogger_002Edll/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelper_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F2c8e7ca976f350cba9836d5565dac56b11e0b56656fa786460eb1395857a6fa_003FThrowHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/Environment/AssemblyExplorer/XmlDocument/@EntryValue"><AssemblyExplorer>
|
<s:String x:Key="/Default/Environment/AssemblyExplorer/XmlDocument/@EntryValue"><AssemblyExplorer>
|
||||||
<Assembly Path="C:\Users\Glax\RiderProjects\GlaxLogger\GlaxLogger\bin\Debug\net7.0\GlaxLogger.dll" />
|
<Assembly Path="C:\Users\Glax\RiderProjects\GlaxLogger\GlaxLogger\bin\Debug\net7.0\GlaxLogger.dll" />
|
||||||
</AssemblyExplorer></s:String></wpf:ResourceDictionary>
|
</AssemblyExplorer></s:String></wpf:ResourceDictionary>
|
@ -1,20 +1,22 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<Authors>Glax</Authors>
|
<Authors>Glax</Authors>
|
||||||
<RepositoryUrl>https://github.com/C9Glax/CShocker</RepositoryUrl>
|
<RepositoryUrl>https://github.com/C9Glax/CShocker</RepositoryUrl>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<Version>2.5.1</Version>
|
<Version>3.0.0</Version>
|
||||||
|
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
|
||||||
|
<LangVersion>latestmajor</LangVersion>
|
||||||
|
<PackageProjectUrl>https://github.com/C9Glax/CShocker</PackageProjectUrl>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
<PackageReference Include="System.IO.Ports" Version="8.0.0" />
|
<PackageReference Include="System.IO.Ports" Version="9.0.1" />
|
||||||
<PackageReference Include="System.Management" Version="8.0.0" />
|
<PackageReference Include="System.Management" Version="9.0.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
@ -59,7 +59,7 @@ public abstract class Api : IDisposable
|
|||||||
while (_workOnQueue)
|
while (_workOnQueue)
|
||||||
if (_queue.Count > 0 && _queue.Dequeue() is { } action)
|
if (_queue.Count > 0 && _queue.Dequeue() is { } action)
|
||||||
{
|
{
|
||||||
this.Logger?.Log(LogLevel.Information, $"Executing: {Enum.GetName(action.Item1)} Intensity: {action.Item3} Duration: {action.Item4}\nShocker:\n{action.Item2.ToString()}");
|
this.Logger?.Log(LogLevel.Information, $"Executing: {Enum.GetName(action.Item1)} Intensity: {action.Item3} Duration: {action.Item4}\nShocker:\n{action.Item2}");
|
||||||
ControlInternal(action.Item1, action.Item2, action.Item3, action.Item4);
|
ControlInternal(action.Item1, action.Item2, action.Item3, action.Item4);
|
||||||
Thread.Sleep(action.Item4 + CommandDelay);
|
Thread.Sleep(action.Item4 + CommandDelay);
|
||||||
}
|
}
|
||||||
|
@ -38,10 +38,10 @@ public static class ApiHttpClient
|
|||||||
HttpClient httpClient = new();
|
HttpClient httpClient = new();
|
||||||
HttpResponseMessage response = httpClient.Send(request);
|
HttpResponseMessage response = httpClient.Send(request);
|
||||||
logger?.Log(!response.IsSuccessStatusCode ? LogLevel.Error : LogLevel.Debug, string.Join("\n\t",
|
logger?.Log(!response.IsSuccessStatusCode ? LogLevel.Error : LogLevel.Debug, string.Join("\n\t",
|
||||||
"Request:",
|
"Response:",
|
||||||
$"\u251c\u2500\u2500 URI: {request.RequestUri}",
|
$"\u251c\u2500\u2500 URI: {request.RequestUri}",
|
||||||
$"\u251c\u2500\u2510 Headers: {string.Concat(response.Headers.Select(h => $"\n\t\u2502 {(response.Headers.Last().Key.Equals(h.Key) ? "\u2514" : "\u251c")} {h.Key}: {string.Join(", ", h.Value)}"))}",
|
$"\u251c\u2500\u2510 Headers: {string.Concat(response.Headers.Select(h => $"\n\t\u2502 {(response.Headers.Last().Key.Equals(h.Key) ? "\u2514" : "\u251c")} {h.Key}: {string.Join(", ", h.Value)}"))}",
|
||||||
$"\u2514\u2500\u2500 Content: {response.Content?.ReadAsStringAsync().Result}"));
|
$"\u2514\u2500\u2500 Content: {response.Content.ReadAsStringAsync().Result}"));
|
||||||
httpClient.Dispose();
|
httpClient.Dispose();
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ using CShocker.Devices.APIs;
|
|||||||
using CShocker.Shockers;
|
using CShocker.Shockers;
|
||||||
using GlaxLogger;
|
using GlaxLogger;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
Logger logger = new (LogLevel.Trace);
|
Logger logger = new (LogLevel.Trace);
|
||||||
|
|
||||||
@ -14,9 +13,11 @@ while(apiKey is null || apiKey.Length < 1)
|
|||||||
|
|
||||||
|
|
||||||
OpenShockHttp openShockHttp = new (apiKey, logger: logger);
|
OpenShockHttp openShockHttp = new (apiKey, logger: logger);
|
||||||
OpenShockShocker shocker = openShockHttp.GetShockers().First();
|
foreach (OpenShockShocker shocker in openShockHttp.GetShockers())
|
||||||
shocker.Control(ControlAction.Vibrate, 20, 1000);
|
{
|
||||||
Thread.Sleep(1100);
|
shocker.Control(ControlAction.Vibrate, 20, 1000);
|
||||||
|
Thread.Sleep(1100);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
File.WriteAllText("shockers.json", JsonConvert.SerializeObject(shocker));
|
File.WriteAllText("shockers.json", JsonConvert.SerializeObject(shocker));
|
||||||
@ -54,5 +55,3 @@ OpenShockShocker deserialized = JsonConvert.DeserializeObject<OpenShockShocker>(
|
|||||||
shocker.Dispose();
|
shocker.Dispose();
|
||||||
deserialized.Dispose();
|
deserialized.Dispose();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
logger.Dispose();
|
|
@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
|
||||||
|
<LangVersion>latestmajor</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -12,7 +13,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="GlaxLogger" Version="1.0.6" />
|
<PackageReference Include="GlaxLogger" Version="1.0.7.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user