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

Check RGBDeviceType.All in RGBSurface.GetDevices

Add a check for the RGBDeviceType.All in the RGBSurface.GetDevices function
This commit is contained in:
Sander Jochems 2019-06-01 16:56:46 +02:00 committed by GitHub
parent 18871b9a27
commit 11d3667021
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"/>.