diff --git a/RGB.NET.Core/RGBSurface.cs b/RGB.NET.Core/RGBSurface.cs index 2d2a2c7..37111b2 100644 --- a/RGB.NET.Core/RGBSurface.cs +++ b/RGB.NET.Core/RGBSurface.cs @@ -204,6 +204,23 @@ namespace RGB.NET.Core _surfaceRectangle.Height = devicesRectangle.Location.Y + devicesRectangle.Size.Height; } + /// + /// Gets all devices of a specific type. + /// + /// The type of devices to get. + /// A list of devices with the specified type. + public IList GetDevices() + where T : class + => new ReadOnlyCollection(_devices.Select(x => x as T).Where(x => x != null).ToList()); + + /// + /// Gets all devices of the specified . + /// + /// The of the devices to get. + /// a list of devices matching the specified . + public IList GetDevices(RGBDeviceType deviceType) + => new ReadOnlyCollection(_devices.Where(x => x.DeviceInfo.DeviceType == deviceType).ToList()); + #endregion } }