Updated device providers to make everything compile again

This commit is contained in:
DarthAffe committed 2021-02-01 23:13:15 +01:00
1 parent 6619539176
commit 57dc9afb32
67 files changed
+190 -661

No files matched your search

@@ -1,5 +1,4 @@
using System.Linq;
using RGB.NET.Core;
using RGB.NET.Core;
namespace RGB.NET.Devices.Logitech
{
@@ -45,31 +44,11 @@ namespace RGB.NET.Devices.Logitech
/// <summary>
/// Initializes the device.
/// </summary>
public void Initialize(UpdateQueue updateQueue)
public virtual void Initialize(UpdateQueue updateQueue)
{
InitializeLayout();
if (Size == Size.Invalid)
{
Rectangle ledRectangle = new Rectangle(this.Select(x => x.LedRectangle));
Size = ledRectangle.Size + new Size(ledRectangle.Location.X, ledRectangle.Location.Y);
}
UpdateQueue = updateQueue;
}
/// <summary>
/// Initializes the <see cref="Led"/> and <see cref="Size"/> of the device.
/// </summary>
protected virtual void InitializeLayout()
{
if (!(DeviceInfo is LogitechRGBDeviceInfo info)) return;
string layout = info.ImageLayout;
string layoutPath = info.LayoutPath;
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(this, @"Layouts\Logitech", $"{layoutPath}.xml"), layout, true);
}
/// <inheritdoc />
public override void Dispose()
{
@@ -1,5 +1,4 @@
using System;
using RGB.NET.Core;
using RGB.NET.Core;
namespace RGB.NET.Devices.Logitech
{
@@ -23,24 +22,8 @@ namespace RGB.NET.Devices.Logitech
/// <inheritdoc />
public string Model { get; }
/// <inheritdoc />
public Uri Image { get; set; }
public object? LayoutMetadata { get; set; }
/// <inheritdoc />
public RGBDeviceLighting Lighting
{
get
{
if (DeviceCaps.HasFlag(LogitechDeviceCaps.PerKeyRGB))
return RGBDeviceLighting.Key;
if (DeviceCaps.HasFlag(LogitechDeviceCaps.DeviceRGB))
return RGBDeviceLighting.Device;
return RGBDeviceLighting.None;
}
}
/// <summary>
/// Gets a flag that describes device capabilities. (<see cref="LogitechDeviceCaps" />)
/// </summary>