mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Profiles - Fixed LEDs of devices that are missing being removed from layers (#733)
This commit is contained in:
1 parent
3f1eaeda29
commit
b83f1f0102
3 files changed
+49
-23
No files matched your search
@@ -1,7 +1,37 @@
|
||||
namespace Artemis.Storage.Entities.Profile;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Artemis.Storage.Entities.Profile;
|
||||
|
||||
public class LedEntity
|
||||
{
|
||||
#region LedEntityEqualityComparer
|
||||
|
||||
private sealed class LedEntityEqualityComparer : IEqualityComparer<LedEntity>
|
||||
{
|
||||
public bool Equals(LedEntity x, LedEntity y)
|
||||
{
|
||||
if (ReferenceEquals(x, y))
|
||||
return true;
|
||||
if (ReferenceEquals(x, null))
|
||||
return false;
|
||||
if (ReferenceEquals(y, null))
|
||||
return false;
|
||||
if (x.GetType() != y.GetType())
|
||||
return false;
|
||||
return x.LedName == y.LedName && x.DeviceIdentifier == y.DeviceIdentifier && x.PhysicalLayout == y.PhysicalLayout;
|
||||
}
|
||||
|
||||
public int GetHashCode(LedEntity obj)
|
||||
{
|
||||
return HashCode.Combine(obj.LedName, obj.DeviceIdentifier, obj.PhysicalLayout);
|
||||
}
|
||||
}
|
||||
|
||||
public static IEqualityComparer<LedEntity> LedEntityComparer { get; } = new LedEntityEqualityComparer();
|
||||
|
||||
#endregion
|
||||
|
||||
public string LedName { get; set; }
|
||||
public string DeviceIdentifier { get; set; }
|
||||
|
||||
|
||||
Reference in new issue
Block a user