mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Plugins - Simplified and streamlined the way plugins provide VMs
Plugins - Added dependency injection to all plugin VMs Plugin settings - Allow injecting plugin settings into any class defined in the plugin assembly
This commit is contained in:
1 parent
aa3c3d6b95
commit
c71faba2c9
29 files changed
+349
-165
No files matched your search
@@ -13,21 +13,38 @@ namespace Artemis.Core.Plugins.Abstract
|
||||
/// </summary>
|
||||
public abstract class DeviceProvider : Plugin
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new instance of the <see cref="DeviceProvider" /> class
|
||||
/// </summary>
|
||||
/// <param name="rgbDeviceProvider"></param>
|
||||
protected DeviceProvider(IRGBDeviceProvider rgbDeviceProvider)
|
||||
{
|
||||
RgbDeviceProvider = rgbDeviceProvider ?? throw new ArgumentNullException(nameof(rgbDeviceProvider));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The RGB.NET device provider backing this Artemis device provider
|
||||
/// </summary>
|
||||
public IRGBDeviceProvider RgbDeviceProvider { get; }
|
||||
|
||||
/// <summary>
|
||||
/// TODO: Make internal while still injecting.
|
||||
/// A logger used by the device provider internally, ignore this
|
||||
/// </summary>
|
||||
[Inject]
|
||||
public ILogger Logger { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void DisablePlugin()
|
||||
{
|
||||
// Does not happen with device providers, they require Artemis to restart
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ResolveAbsolutePath(Type type, object sender, ResolvePathEventArgs e)
|
||||
{
|
||||
if (sender.GetType() == type || sender.GetType().IsGenericType(type))
|
||||
|
||||
Reference in new issue
Block a user