Changed all namespaces to file-scope

This commit is contained in:
DarthAffe committed 2021-11-13 17:35:08 +01:00
1 parent a0c6ccebea
commit 30624035f1
353 files changed
+35775 -36129

No files matched your search

@@ -1,10 +1,9 @@
using RGB.NET.Core;
namespace RGB.NET.Devices.Wooting.Generic
{
/// <summary>
/// Represents a Wooting RGB-device.
/// </summary>
public interface IWootingRGBDevice : IRGBDevice
{ }
}
namespace RGB.NET.Devices.Wooting.Generic;
/// <summary>
/// Represents a Wooting RGB-device.
/// </summary>
public interface IWootingRGBDevice : IRGBDevice
{ }
@@ -1,26 +1,25 @@
using RGB.NET.Core;
namespace RGB.NET.Devices.Wooting.Generic
namespace RGB.NET.Devices.Wooting.Generic;
/// <inheritdoc cref="AbstractRGBDevice{TDeviceInfo}" />
/// <inheritdoc cref="IWootingRGBDevice" />
/// <summary>
/// Represents a Wooting-device
/// </summary>
public abstract class WootingRGBDevice<TDeviceInfo> : AbstractRGBDevice<TDeviceInfo>, IWootingRGBDevice
where TDeviceInfo : WootingRGBDeviceInfo
{
/// <inheritdoc cref="AbstractRGBDevice{TDeviceInfo}" />
/// <inheritdoc cref="IWootingRGBDevice" />
#region Constructors
/// <summary>
/// Represents a Wooting-device
/// Initializes a new instance of the <see cref="WootingRGBDevice{TDeviceInfo}"/> class.
/// </summary>
public abstract class WootingRGBDevice<TDeviceInfo> : AbstractRGBDevice<TDeviceInfo>, IWootingRGBDevice
where TDeviceInfo : WootingRGBDeviceInfo
{
#region Constructors
/// <param name="info">The generic information provided by Wooting for the device.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
protected WootingRGBDevice(TDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, new WootingUpdateQueue(updateTrigger))
{ }
/// <summary>
/// Initializes a new instance of the <see cref="WootingRGBDevice{TDeviceInfo}"/> class.
/// </summary>
/// <param name="info">The generic information provided by Wooting for the device.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
protected WootingRGBDevice(TDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, new WootingUpdateQueue(updateTrigger))
{ }
#endregion
}
}
#endregion
}
@@ -2,54 +2,53 @@
using RGB.NET.Devices.Wooting.Enum;
using RGB.NET.Devices.Wooting.Native;
namespace RGB.NET.Devices.Wooting.Generic
namespace RGB.NET.Devices.Wooting.Generic;
/// <inheritdoc />
/// <summary>
/// Represents a generic information for a Wooting-<see cref="T:RGB.NET.Core.IRGBDevice" />.
/// </summary>
public class WootingRGBDeviceInfo : IRGBDeviceInfo
{
#region Properties & Fields
/// <inheritdoc />
public RGBDeviceType DeviceType { get; }
/// <inheritdoc />
public string DeviceName { get; }
/// <inheritdoc />
public string Manufacturer => "Wooting";
/// <inheritdoc />
public string Model { get; }
/// <inheritdoc />
public object? LayoutMetadata { get; set; }
/// <summary>
/// Represents a generic information for a Wooting-<see cref="T:RGB.NET.Core.IRGBDevice" />.
/// Gets the <see cref="WootingDeviceType"/> of the <see cref="WootingRGBDevice{TDeviceInfo}"/>.
/// </summary>
public class WootingRGBDeviceInfo : IRGBDeviceInfo
public WootingDeviceType WootingDeviceType { get; }
#endregion
#region Constructors
/// <summary>
/// Internal constructor of managed <see cref="WootingRGBDeviceInfo"/>.
/// </summary>
/// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param>
/// <param name="deviceInfo">The <see cref="_WootingDeviceInfo"/> of the <see cref="IRGBDevice"/>.</param>
internal WootingRGBDeviceInfo(RGBDeviceType deviceType, _WootingDeviceInfo deviceInfo)
{
#region Properties & Fields
this.DeviceType = deviceType;
this.WootingDeviceType = deviceInfo.DeviceType;
/// <inheritdoc />
public RGBDeviceType DeviceType { get; }
/// <inheritdoc />
public string DeviceName { get; }
/// <inheritdoc />
public string Manufacturer => "Wooting";
/// <inheritdoc />
public string Model { get; }
/// <inheritdoc />
public object? LayoutMetadata { get; set; }
/// <summary>
/// Gets the <see cref="WootingDeviceType"/> of the <see cref="WootingRGBDevice{TDeviceInfo}"/>.
/// </summary>
public WootingDeviceType WootingDeviceType { get; }
#endregion
#region Constructors
/// <summary>
/// Internal constructor of managed <see cref="WootingRGBDeviceInfo"/>.
/// </summary>
/// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param>
/// <param name="deviceInfo">The <see cref="_WootingDeviceInfo"/> of the <see cref="IRGBDevice"/>.</param>
internal WootingRGBDeviceInfo(RGBDeviceType deviceType, _WootingDeviceInfo deviceInfo)
{
this.DeviceType = deviceType;
this.WootingDeviceType = deviceInfo.DeviceType;
Model = deviceInfo.Model;
DeviceName = DeviceHelper.CreateDeviceName(Manufacturer, Model);
}
#endregion
Model = deviceInfo.Model;
DeviceName = DeviceHelper.CreateDeviceName(Manufacturer, Model);
}
}
#endregion
}
@@ -2,44 +2,43 @@
using RGB.NET.Core;
using RGB.NET.Devices.Wooting.Native;
namespace RGB.NET.Devices.Wooting.Generic
namespace RGB.NET.Devices.Wooting.Generic;
/// <inheritdoc />
/// <summary>
/// Represents the update-queue performing updates for cooler master devices.
/// </summary>
public class WootingUpdateQueue : UpdateQueue
{
/// <inheritdoc />
#region Constructors
/// <summary>
/// Represents the update-queue performing updates for cooler master devices.
/// Initializes a new instance of the <see cref="WootingUpdateQueue"/> class.
/// </summary>
public class WootingUpdateQueue : UpdateQueue
/// <param name="updateTrigger">The update trigger used by this queue.</param>
public WootingUpdateQueue(IDeviceUpdateTrigger updateTrigger)
: base(updateTrigger)
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="WootingUpdateQueue"/> class.
/// </summary>
/// <param name="updateTrigger">The update trigger used by this queue.</param>
public WootingUpdateQueue(IDeviceUpdateTrigger updateTrigger)
: base(updateTrigger)
{
}
#endregion
#region Methods
/// <inheritdoc />
protected override void Update(in ReadOnlySpan<(object key, Color color)> dataSet)
{
lock (_WootingSDK.SdkLock)
{
foreach ((object key, Color color) in dataSet)
{
(int row, int column) = ((int, int))key;
_WootingSDK.ArraySetSingle((byte)row, (byte)column, color.GetR(), color.GetG(), color.GetB());
}
_WootingSDK.ArrayUpdateKeyboard();
}
}
#endregion
}
}
#endregion
#region Methods
/// <inheritdoc />
protected override void Update(in ReadOnlySpan<(object key, Color color)> dataSet)
{
lock (_WootingSDK.SdkLock)
{
foreach ((object key, Color color) in dataSet)
{
(int row, int column) = ((int, int))key;
_WootingSDK.ArraySetSingle((byte)row, (byte)column, color.GetR(), color.GetG(), color.GetB());
}
_WootingSDK.ArrayUpdateKeyboard();
}
}
#endregion
}