-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathAbstractOpenRGBDevice.cs
43 lines (34 loc) · 1.24 KB
/
AbstractOpenRGBDevice.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using RGB.NET.Core;
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
{
#region Constructors
/// <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
#region Methods
private bool Equals(AbstractOpenRGBDevice<TDeviceInfo> other)
{
return DeviceInfo.DeviceName == other.DeviceInfo.DeviceName;
}
public override bool Equals(object? obj)
{
return ReferenceEquals(this, obj) || (obj is AbstractOpenRGBDevice<TDeviceInfo> other && Equals(other));
}
public override int GetHashCode()
{
return DeviceInfo.DeviceName.GetHashCode();
}
#endregion
}