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,70 +1,69 @@
using System.Collections.Generic;
using RGB.NET.Core;
namespace RGB.NET.Devices.CoolerMaster
namespace RGB.NET.Devices.CoolerMaster;
/// <summary>
/// Contains all the hardware-id mappings for CoolerMaster devices.
/// </summary>
internal static class CoolerMasterMouseLedMappings
{
#region Properties & Fields
/// <summary>
/// Contains all the hardware-id mappings for CoolerMaster devices.
/// </summary>
internal static class CoolerMasterMouseLedMappings
{
#region Properties & Fields
// ReSharper disable once InconsistentNaming
public static readonly Dictionary<CoolerMasterDevicesIndexes, Dictionary<LedId, (int row, int column)>> Mapping =
new()
{
{ CoolerMasterDevicesIndexes.MasterMouse_L, new Dictionary<LedId, (int row, int column)>
{
{ LedId.Mouse1, (0,0) },
{ LedId.Mouse2, (0,1) },
{ LedId.Mouse3, (0,2) },
{ LedId.Mouse4, (0,3) }
}
},
/// <summary>
/// Contains all the hardware-id mappings for CoolerMaster devices.
/// </summary>
// ReSharper disable once InconsistentNaming
public static readonly Dictionary<CoolerMasterDevicesIndexes, Dictionary<LedId, (int row, int column)>> Mapping =
new()
{
{ CoolerMasterDevicesIndexes.MasterMouse_L, new Dictionary<LedId, (int row, int column)>
{
{ LedId.Mouse1, (0,0) },
{ LedId.Mouse2, (0,1) },
{ LedId.Mouse3, (0,2) },
{ LedId.Mouse4, (0,3) }
}
},
{ CoolerMasterDevicesIndexes.MasterMouse_S, new Dictionary<LedId, (int row, int column)>
{
{ LedId.Mouse1, (0,0) },
{ LedId.Mouse2, (0,1) }
}
},
{ CoolerMasterDevicesIndexes.MasterMouse_S, new Dictionary<LedId, (int row, int column)>
{
{ LedId.Mouse1, (0,0) },
{ LedId.Mouse2, (0,1) }
}
},
{ CoolerMasterDevicesIndexes.MM530, new Dictionary<LedId, (int row, int column)>
{
{ LedId.Mouse1, (0,0) },
{ LedId.Mouse2, (0,1) },
{ LedId.Mouse3, (0,2) }
}
},
{ CoolerMasterDevicesIndexes.MM530, new Dictionary<LedId, (int row, int column)>
{
{ LedId.Mouse1, (0,0) },
{ LedId.Mouse2, (0,1) },
{ LedId.Mouse3, (0,2) }
}
},
{ CoolerMasterDevicesIndexes.MM520, new Dictionary<LedId, (int row, int column)>
{
{ LedId.Mouse1, (0,0) },
{ LedId.Mouse2, (0,1) },
{ LedId.Mouse3, (0,2) }
}
},
{ CoolerMasterDevicesIndexes.MM520, new Dictionary<LedId, (int row, int column)>
{
{ LedId.Mouse1, (0,0) },
{ LedId.Mouse2, (0,1) },
{ LedId.Mouse3, (0,2) }
}
},
{ CoolerMasterDevicesIndexes.MM830, new Dictionary<LedId, (int row, int column)>
{
{ LedId.Mouse1, (0,0) },
{ LedId.Mouse2, (0,1) },
{ LedId.Mouse3, (0,2) },
{ LedId.Mouse4, (0,3) },
{ LedId.Mouse5, (0,4) },
{ LedId.Mouse6, (0,5) },
{ LedId.Mouse7, (0,6) },
{ LedId.Mouse8, (0,7) },
{ LedId.Mouse9, (0,8) },
{ LedId.Mouse10, (0,9) },
}
},
};
{ CoolerMasterDevicesIndexes.MM830, new Dictionary<LedId, (int row, int column)>
{
{ LedId.Mouse1, (0,0) },
{ LedId.Mouse2, (0,1) },
{ LedId.Mouse3, (0,2) },
{ LedId.Mouse4, (0,3) },
{ LedId.Mouse5, (0,4) },
{ LedId.Mouse6, (0,5) },
{ LedId.Mouse7, (0,6) },
{ LedId.Mouse8, (0,7) },
{ LedId.Mouse9, (0,8) },
{ LedId.Mouse10, (0,9) },
}
},
};
#endregion
}
}
#endregion
}
@@ -1,43 +1,42 @@
using System.Collections.Generic;
using RGB.NET.Core;
namespace RGB.NET.Devices.CoolerMaster
namespace RGB.NET.Devices.CoolerMaster;
/// <inheritdoc cref="CoolerMasterRGBDevice{TDeviceInfo}" />
/// <summary>
/// Represents a CoolerMaster mouse.
/// </summary>
public class CoolerMasterMouseRGBDevice : CoolerMasterRGBDevice<CoolerMasterMouseRGBDeviceInfo>, IMouse
{
/// <inheritdoc cref="CoolerMasterRGBDevice{TDeviceInfo}" />
/// <summary>
/// Represents a CoolerMaster mouse.
/// </summary>
public class CoolerMasterMouseRGBDevice : CoolerMasterRGBDevice<CoolerMasterMouseRGBDeviceInfo>, IMouse
{
#region Constructors
#region Constructors
/// <inheritdoc />
/// <summary>
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterMouseRGBDevice" /> class.
/// </summary>
/// <param name="info">The specific information provided by CoolerMaster for the mouse</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal CoolerMasterMouseRGBDevice(CoolerMasterMouseRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, updateTrigger)
{
InitializeLayout();
}
#endregion
#region Methods
private void InitializeLayout()
{
Dictionary<LedId, (int row, int column)> mapping = CoolerMasterMouseLedMappings.Mapping[DeviceInfo.DeviceIndex];
foreach (KeyValuePair<LedId, (int row, int column)> led in mapping)
AddLed(led.Key, new Point(led.Value.column * 19, led.Value.row * 19), new Size(19, 19));
}
/// <inheritdoc />
protected override object GetLedCustomData(LedId ledId) => CoolerMasterMouseLedMappings.Mapping[DeviceInfo.DeviceIndex][ledId];
#endregion
/// <inheritdoc />
/// <summary>
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterMouseRGBDevice" /> class.
/// </summary>
/// <param name="info">The specific information provided by CoolerMaster for the mouse</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal CoolerMasterMouseRGBDevice(CoolerMasterMouseRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, updateTrigger)
{
InitializeLayout();
}
}
#endregion
#region Methods
private void InitializeLayout()
{
Dictionary<LedId, (int row, int column)> mapping = CoolerMasterMouseLedMappings.Mapping[DeviceInfo.DeviceIndex];
foreach (KeyValuePair<LedId, (int row, int column)> led in mapping)
AddLed(led.Key, new Point(led.Value.column * 19, led.Value.row * 19), new Size(19, 19));
}
/// <inheritdoc />
protected override object GetLedCustomData(LedId ledId) => CoolerMasterMouseLedMappings.Mapping[DeviceInfo.DeviceIndex][ledId];
#endregion
}
@@ -1,24 +1,23 @@
using RGB.NET.Core;
namespace RGB.NET.Devices.CoolerMaster
namespace RGB.NET.Devices.CoolerMaster;
/// <inheritdoc />
/// <summary>
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterMouseRGBDevice" />.
/// </summary>
public class CoolerMasterMouseRGBDeviceInfo : CoolerMasterRGBDeviceInfo
{
#region Constructors
/// <inheritdoc />
/// <summary>
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterMouseRGBDevice" />.
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterMouseRGBDeviceInfo" />.
/// </summary>
public class CoolerMasterMouseRGBDeviceInfo : CoolerMasterRGBDeviceInfo
{
#region Constructors
/// <param name="deviceIndex">The index of the <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterMouseRGBDevice" />.</param>
internal CoolerMasterMouseRGBDeviceInfo(CoolerMasterDevicesIndexes deviceIndex)
: base(RGBDeviceType.Mouse, deviceIndex)
{ }
/// <inheritdoc />
/// <summary>
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterMouseRGBDeviceInfo" />.
/// </summary>
/// <param name="deviceIndex">The index of the <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterMouseRGBDevice" />.</param>
internal CoolerMasterMouseRGBDeviceInfo(CoolerMasterDevicesIndexes deviceIndex)
: base(RGBDeviceType.Mouse, deviceIndex)
{ }
#endregion
}
}
#endregion
}