1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 10:08:31 +00:00

Merge pull request #73 from Sander0542/patch-1

Check RGBDeviceType.All in RGBSurface.GetDevices
This commit is contained in:
DarthAffe 2019-06-02 11:37:40 +02:00 committed by GitHub
commit 5f138f7638
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -250,7 +250,7 @@ namespace RGB.NET.Core
/// <param name="deviceType">The <see cref="RGBDeviceType"/> of the devices to get.</param>
/// <returns>a list of devices matching the specified <see cref="RGBDeviceType"/>.</returns>
public IList<IRGBDevice> GetDevices(RGBDeviceType deviceType)
=> new ReadOnlyCollection<IRGBDevice>(_devices.Where(x => x.DeviceInfo.DeviceType == deviceType).ToList());
=> new ReadOnlyCollection<IRGBDevice>(deviceType == RGBDeviceType.All ? _devices : _devices.Where(x => x.DeviceInfo.DeviceType == deviceType).ToList());
/// <summary>
/// Registers the provided <see cref="IUpdateTrigger"/>.