OpenRGB - Switch to file scoped namespaces

This commit is contained in:
Diogo Trindade committed 2022-09-25 15:37:43 +01:00
1 parent 2d203d31ab
commit 7954b876ef
14 files changed
+562 -607

No files matched your search

@@ -1,25 +1,24 @@
using RGB.NET.Core;
namespace RGB.NET.Devices.OpenRGB
namespace RGB.NET.Devices.OpenRGB;
/// <inheritdoc cref="AbstractRGBDevice{TDeviceInfo}" />
/// <summary>
/// Represents a generic OpenRGB Device.
/// </summary>
public abstract class AbstractOpenRGBDevice<TDeviceInfo> : AbstractRGBDevice<TDeviceInfo>, IOpenRGBDevice
where TDeviceInfo : OpenRGBDeviceInfo
{
/// <inheritdoc cref="AbstractRGBDevice{TDeviceInfo}" />
#region Constructors
/// <summary>
/// Represents a generic OpenRGB Device.
/// Initializes a new instance of the <see cref="AbstractOpenRGBDevice{TDeviceInfo}"/> class.
/// </summary>
public abstract class AbstractOpenRGBDevice<TDeviceInfo> : AbstractRGBDevice<TDeviceInfo>, IOpenRGBDevice
where TDeviceInfo : AbstractOpenRGBDeviceInfo
{
#region Constructors
/// <param name="info">The generic information provided by OpenRGB for this device.</param>
/// <param name="updateQueue">The queue used to update this device.</param>
protected AbstractOpenRGBDevice(TDeviceInfo info, IUpdateQueue updateQueue)
: base(info, updateQueue)
{ }
/// <summary>
/// Initializes a new instance of the <see cref="AbstractOpenRGBDevice{TDeviceInfo}"/> class.
/// </summary>
/// <param name="info">The generic information provided by OpenRGB for this device.</param>
/// <param name="updateQueue">The queue used to update this device.</param>
protected AbstractOpenRGBDevice(TDeviceInfo info, IUpdateQueue updateQueue)
: base(info, updateQueue)
{ }
#endregion
}
#endregion
}
@@ -1,45 +0,0 @@
using RGB.NET.Core;
using System.Collections.Generic;
using OpenRGBDevice = OpenRGB.NET.Models.Device;
namespace RGB.NET.Devices.OpenRGB
{
/// <summary>
/// Represents generic information for an OpenRGB Device
/// </summary>
public abstract class AbstractOpenRGBDeviceInfo : IRGBDeviceInfo
{
/// <inheritdoc />
public RGBDeviceType DeviceType { get; }
/// <inheritdoc />
public string DeviceName { get; }
/// <inheritdoc />
public string Manufacturer { get; }
/// <inheritdoc />
public string Model { get; }
/// <inheritdoc />
public object? LayoutMetadata { get; set; }
/// <summary>
/// Gets the OpenRGB device.
/// </summary>
public OpenRGBDevice OpenRGBDevice { get; }
/// <summary>
/// Initializes a new instance of <see cref="AbstractOpenRGBDeviceInfo"/>.
/// </summary>
/// <param name="openRGBDevice">The OpenRGB device to extract information from.</param>
protected AbstractOpenRGBDeviceInfo(OpenRGBDevice openRGBDevice)
{
OpenRGBDevice = openRGBDevice;
DeviceType = Helper.GetRgbNetDeviceType(openRGBDevice.Type);
Manufacturer = Helper.GetVendorName(openRGBDevice);
Model = Helper.GetModelName(openRGBDevice);
DeviceName = DeviceHelper.CreateDeviceName(Manufacturer, Model);
}
}
}
@@ -1,7 +1,9 @@
using RGB.NET.Core;
namespace RGB.NET.Devices.OpenRGB
{
internal interface IOpenRGBDevice : IRGBDevice
{ }
}
namespace RGB.NET.Devices.OpenRGB;
/// <summary>
/// Represents a generic OpenRGB Device.
/// </summary>
public interface IOpenRGBDevice : IRGBDevice
{ }
@@ -0,0 +1,44 @@
using RGB.NET.Core;
using System.Collections.Generic;
using OpenRGBDevice = OpenRGB.NET.Models.Device;
namespace RGB.NET.Devices.OpenRGB;
/// <summary>
/// Represents generic information for an OpenRGB Device
/// </summary>
public class OpenRGBDeviceInfo : IRGBDeviceInfo
{
/// <inheritdoc />
public RGBDeviceType DeviceType { get; }
/// <inheritdoc />
public string DeviceName { get; }
/// <inheritdoc />
public string Manufacturer { get; }
/// <inheritdoc />
public string Model { get; }
/// <inheritdoc />
public object? LayoutMetadata { get; set; }
/// <summary>
/// Gets the OpenRGB device.
/// </summary>
public OpenRGBDevice OpenRGBDevice { get; }
/// <summary>
/// Initializes a new instance of <see cref="OpenRGBDeviceInfo"/>.
/// </summary>
/// <param name="openRGBDevice">The OpenRGB device to extract information from.</param>
internal OpenRGBDeviceInfo(OpenRGBDevice openRGBDevice)
{
OpenRGBDevice = openRGBDevice;
DeviceType = Helper.GetRgbNetDeviceType(openRGBDevice.Type);
Manufacturer = Helper.GetVendorName(openRGBDevice);
Model = Helper.GetModelName(openRGBDevice);
DeviceName = DeviceHelper.CreateDeviceName(Manufacturer, Model);
}
}