mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-12 21:38:38 +00:00
Moved KeyboardProviders to DI
This commit is contained in:
parent
2bc7bbfd58
commit
b9a55b896a
@ -292,7 +292,6 @@
|
||||
<Compile Include="KeyboardProviders\Logitech\Utilities\KeyMap.cs" />
|
||||
<Compile Include="KeyboardProviders\Logitech\Utilities\LogitechGSDK.cs" />
|
||||
<Compile Include="KeyboardProviders\Logitech\Utilities\OrionUtilities.cs" />
|
||||
<Compile Include="KeyboardProviders\ProviderHelper.cs" />
|
||||
<Compile Include="KeyboardProviders\Razer\BlackWidow.cs" />
|
||||
<Compile Include="KeyboardProviders\Razer\Utilities\RazerUtilities.cs" />
|
||||
<Compile Include="Managers\EffectManager.cs" />
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
using Artemis.Modules.Effects.AudioVisualizer;
|
||||
using Artemis.KeyboardProviders;
|
||||
using Artemis.KeyboardProviders.Corsair;
|
||||
using Artemis.KeyboardProviders.Logitech;
|
||||
using Artemis.KeyboardProviders.Razer;
|
||||
using Artemis.Modules.Effects.AudioVisualizer;
|
||||
using Artemis.Modules.Effects.Debug;
|
||||
using Artemis.Modules.Effects.TypeWave;
|
||||
using Artemis.Modules.Games.CounterStrike;
|
||||
@ -31,6 +35,11 @@ namespace Artemis.InjectionModules
|
||||
|
||||
// Overlays
|
||||
Bind<OverlayViewModel>().To<VolumeDisplayViewModel>().InSingletonScope();
|
||||
|
||||
// Keyboard Providers
|
||||
Bind<KeyboardProvider>().To<CorsairRGB>().InSingletonScope();
|
||||
Bind<KeyboardProvider>().To<Orion>().InSingletonScope();
|
||||
Bind<KeyboardProvider>().To<BlackWidow>().InSingletonScope();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -13,7 +13,7 @@ using Point = System.Drawing.Point;
|
||||
|
||||
namespace Artemis.KeyboardProviders.Corsair
|
||||
{
|
||||
internal class CorsairRGB : KeyboardProvider
|
||||
public class CorsairRGB : KeyboardProvider
|
||||
{
|
||||
private CorsairKeyboard _keyboard;
|
||||
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Artemis.KeyboardProviders.Corsair;
|
||||
using Artemis.KeyboardProviders.Logitech;
|
||||
using Artemis.KeyboardProviders.Razer;
|
||||
|
||||
namespace Artemis.KeyboardProviders
|
||||
{
|
||||
public static class ProviderHelper
|
||||
{
|
||||
public static List<KeyboardProvider> GetKeyboardProviders()
|
||||
{
|
||||
return new List<KeyboardProvider>
|
||||
{
|
||||
new CorsairRGB(),
|
||||
new Orion(),
|
||||
new BlackWidow()
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -20,13 +20,13 @@ namespace Artemis.Managers
|
||||
private readonly ILogger _logger;
|
||||
private KeyboardProvider _activeKeyboard;
|
||||
|
||||
public KeyboardManager(IEventAggregator events, ILogger logger)
|
||||
public KeyboardManager(IEventAggregator events, ILogger logger, List<KeyboardProvider> keyboardProviders)
|
||||
{
|
||||
_logger = logger;
|
||||
_logger.Info("Intializing KeyboardManager");
|
||||
|
||||
_events = events;
|
||||
KeyboardProviders = ProviderHelper.GetKeyboardProviders();
|
||||
KeyboardProviders = keyboardProviders;
|
||||
|
||||
_logger.Info("Intialized KeyboardManager");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user