mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Plugins - Removed plugin info from constructor
This commit is contained in:
1 parent
33bb3ffa6c
commit
1d35a02d5b
49 files changed
+305
-390
No files matched your search
@@ -15,19 +15,20 @@ namespace Artemis.Plugins.Devices.WS281X
|
||||
public class WS281XDeviceProvider : DeviceProvider
|
||||
{
|
||||
private readonly IRgbService _rgbService;
|
||||
private readonly PluginSettings _settings;
|
||||
|
||||
public WS281XDeviceProvider(PluginInfo pluginInfo, IRgbService rgbService, PluginSettings settings) : base(pluginInfo, RGB.NET.Devices.WS281X.WS281XDeviceProvider.Instance)
|
||||
public WS281XDeviceProvider(IRgbService rgbService, PluginSettings settings) : base(RGB.NET.Devices.WS281X.WS281XDeviceProvider.Instance)
|
||||
{
|
||||
Settings = settings;
|
||||
_settings = settings;
|
||||
_rgbService = rgbService;
|
||||
HasConfigurationViewModel = true;
|
||||
}
|
||||
|
||||
public PluginSettings Settings { get; }
|
||||
|
||||
public override void EnablePlugin()
|
||||
{
|
||||
var definitions = Settings.GetSetting<List<DeviceDefinition>>("DeviceDefinitions");
|
||||
HasConfigurationViewModel = true;
|
||||
|
||||
var definitions = _settings.GetSetting<List<DeviceDefinition>>("DeviceDefinitions");
|
||||
if (definitions.Value == null)
|
||||
definitions.Value = new List<DeviceDefinition>();
|
||||
|
||||
@@ -53,10 +54,10 @@ namespace Artemis.Plugins.Devices.WS281X
|
||||
{
|
||||
// TODO: Remove the device provider from the surface
|
||||
}
|
||||
|
||||
|
||||
public override PluginConfigurationViewModel GetConfigurationViewModel()
|
||||
{
|
||||
return new WS281XConfigurationViewModel(this, Settings);
|
||||
return new WS281XConfigurationViewModel(this, _settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user