mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-10 20:46:24 +00:00
Fixed some code issues
This commit is contained in:
1 parent
2086b3729d
commit
8e212190ae
76 files changed
+375
-241
No files matched your search
@@ -3,8 +3,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Logitech
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a Id of a <see cref="Led"/> on a <see cref="LogitechRGBDevice"/>.
|
||||
/// Represents a Id of a <see cref="T:RGB.NET.Core.Led" /> on a <see cref="T:RGB.NET.Devices.Logitech.LogitechRGBDevice" />.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{" + nameof(LedId) + "}")]
|
||||
public class LogitechLedId : ILedId
|
||||
|
||||
@@ -8,6 +8,7 @@ using RGB.NET.Devices.Logitech.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Logitech
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic Logitech-device. (keyboard, mouse, headset, mousepad).
|
||||
/// </summary>
|
||||
@@ -15,8 +16,9 @@ namespace RGB.NET.Devices.Logitech
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets information about the <see cref="LogitechRGBDevice"/>.
|
||||
/// Gets information about the <see cref="T:RGB.NET.Devices.Logitech.LogitechRGBDevice" />.
|
||||
/// </summary>
|
||||
public override IRGBDeviceInfo DeviceInfo { get; }
|
||||
|
||||
@@ -74,12 +76,10 @@ namespace RGB.NET.Devices.Logitech
|
||||
if (layout.Leds != null)
|
||||
foreach (LedLayout layoutLed in layout.Leds)
|
||||
{
|
||||
LogitechLedIds ledId;
|
||||
if (Enum.TryParse(layoutLed.Id, true, out ledId))
|
||||
if (Enum.TryParse(layoutLed.Id, true, out LogitechLedIds ledId))
|
||||
{
|
||||
LogitechLedId id = new LogitechLedId(this, ledId);
|
||||
Led led;
|
||||
if (!LedMapping.TryGetValue(id, out led))
|
||||
if (!LedMapping.TryGetValue(id, out Led led))
|
||||
led = InitializeLed(id, new Rectangle());
|
||||
|
||||
led.LedRectangle.Location.X = layoutLed.X;
|
||||
@@ -110,8 +110,7 @@ namespace RGB.NET.Devices.Logitech
|
||||
foreach (Led led in leds)
|
||||
{
|
||||
//TODO DarthAffe 26.03.2017: This is only needed since update by name doesn't work as expected for all keys ...
|
||||
int bitmapOffset;
|
||||
if (BitmapMapping.BitmapOffset.TryGetValue(((LogitechLedId)led.Id).LedId, out bitmapOffset))
|
||||
if (BitmapMapping.BitmapOffset.TryGetValue(((LogitechLedId)led.Id).LedId, out int bitmapOffset))
|
||||
{
|
||||
if (bitmap == null)
|
||||
bitmap = BitmapMapping.CreateBitmap();
|
||||
|
||||
@@ -3,8 +3,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Logitech
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a Logitech-<see cref="IRGBDevice"/>.
|
||||
/// Represents a generic information for a Logitech-<see cref="T:RGB.NET.Core.IRGBDevice" />.
|
||||
/// </summary>
|
||||
public class LogitechRGBDeviceInfo : IRGBDeviceInfo
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Logitech
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a logitech keyboard.
|
||||
/// </summary>
|
||||
@@ -21,8 +22,9 @@ namespace RGB.NET.Devices.Logitech
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LogitechKeyboardRGBDevice"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Logitech.LogitechKeyboardRGBDevice" /> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The specific information provided by logitech for the keyboard</param>
|
||||
internal LogitechKeyboardRGBDevice(LogitechKeyboardRGBDeviceInfo info)
|
||||
@@ -41,7 +43,7 @@ namespace RGB.NET.Devices.Logitech
|
||||
string model = KeyboardDeviceInfo.Model.Replace(" ", string.Empty).ToUpper();
|
||||
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(
|
||||
$@"Layouts\Logitech\Keyboards\{model}\{KeyboardDeviceInfo.PhysicalLayout.ToString().ToUpper()}.xml"),
|
||||
KeyboardDeviceInfo.LogicalLayout.ToString(), PathHelper.GetAbsolutePath($@"Images\Logitech\Keyboards"));
|
||||
KeyboardDeviceInfo.LogicalLayout.ToString(), PathHelper.GetAbsolutePath(@"Images\Logitech\Keyboards"));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -7,8 +7,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Logitech
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="LogitechKeyboardRGBDevice"/>.
|
||||
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Logitech.LogitechKeyboardRGBDevice" />.
|
||||
/// </summary>
|
||||
public class LogitechKeyboardRGBDeviceInfo : LogitechRGBDeviceInfo
|
||||
{
|
||||
@@ -28,12 +29,13 @@ namespace RGB.NET.Devices.Logitech
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Internal constructor of managed <see cref="LogitechKeyboardRGBDeviceInfo"/>.
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Logitech.LogitechKeyboardRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="model">The represented device model.</param>
|
||||
/// <param name="deviceCaps">The lighting-capabilities of the device.</param>
|
||||
/// <param name="culture">The <see cref="CultureInfo"/> of the layout this keyboard is using</param>
|
||||
/// <param name="culture">The <see cref="T:System.Globalization.CultureInfo" /> of the layout this keyboard is using</param>
|
||||
internal LogitechKeyboardRGBDeviceInfo(string model, LogitechDeviceCaps deviceCaps, CultureInfo culture)
|
||||
: base(RGBDeviceType.Keyboard, model, deviceCaps)
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ using RGB.NET.Devices.Logitech.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Logitech
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a device provider responsible for logitech devices.
|
||||
/// </summary>
|
||||
@@ -53,7 +54,7 @@ namespace RGB.NET.Devices.Logitech
|
||||
/// <summary>
|
||||
/// Gets or sets a function to get the culture for a specific device.
|
||||
/// </summary>
|
||||
public Func<CultureInfo> GetCulture { get; set; } = () => CultureHelper.GetCurrentCulture();
|
||||
public Func<CultureInfo> GetCulture { get; set; } = CultureHelper.GetCurrentCulture;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in new issue
Block a user