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 authored and GitHub committed 2019-06-01 16:56:46 +02:00
1 parent 18871b9a27
commit 11d3667021
1 file changed
+1 -1
+1 -1
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"/>.