Updated Fody

Add support for overriding ResolvingAbsolutePath
This commit is contained in:
Robert Beekman committed 2019-08-20 17:30:11 +02:00
1 parent 8e7d543a80
commit cad98ae850
5 files changed
+27 -8

No files matched your search

@@ -75,4 +75,11 @@
<PropertyGroup>
<PostBuildEvent>(robocopy $(TargetDir) %25ProgramData%25\Artemis\plugins\$(ProjectName) /E /NFL /NDL /NJH /NJS /nc /ns /np) ^&amp; IF %25ERRORLEVEL%25 LEQ 4 exit /B 0</PostBuildEvent>
</PropertyGroup>
<Import Project="..\packages\RGB.NET.Resources.Corsair.0.3.0.234\build\RGB.NET.Resources.Corsair.targets" Condition="Exists('..\packages\RGB.NET.Resources.Corsair.0.3.0.234\build\RGB.NET.Resources.Corsair.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\RGB.NET.Resources.Corsair.0.3.0.234\build\RGB.NET.Resources.Corsair.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Resources.Corsair.0.3.0.234\build\RGB.NET.Resources.Corsair.targets'))" />
</Target>
</Project>
@@ -5,6 +5,7 @@ using System.Reflection;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Models;
using Artemis.Core.Services.Interfaces;
using RGB.NET.Core;
using RGB.NET.Devices.Corsair;
namespace Artemis.Plugins.Devices.Corsair
@@ -21,11 +22,21 @@ namespace Artemis.Plugins.Devices.Corsair
public override void EnablePlugin()
{
PathHelper.ResolvingAbsolutePath += ResolveCorsairPath;
CorsairDeviceProvider.PossibleX64NativePaths.Add(Path.Combine(PluginInfo.Directory.FullName, "x64", "CUESDK.dll"));
CorsairDeviceProvider.PossibleX86NativePaths.Add(Path.Combine(PluginInfo.Directory.FullName, "x86", "CUESDK.dll"));
_rgbService.AddDeviceProvider(CorsairDeviceProvider.Instance);
}
private void ResolveCorsairPath(object sender, ResolvePathEventArgs e)
{
if (e.RelativePart.Contains("Layouts\\Corsair"))
{
// Start from the plugin directory
e.FinalPath = Path.Combine(PluginInfo.Directory.FullName, e.RelativePart, e.FileName);
}
}
public override void DisablePlugin()
{
// TODO: Remove the device provider from the surface
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="RGB.NET.Resources.Corsair" version="0.3.0.234" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
</packages>