Class SurfaceExtensions
Offers some extensions and helper-methods for the work with the surface.
Inherited Members
Namespace: RGB.NET.Core
Assembly: RGB.NET.Core.dll
Syntax
public static class SurfaceExtensions
Methods
| Edit this page View SourceAlignDevices(RGBSurface)
Automatically aligns all devices to prevent overlaps.
Declaration
public static void AlignDevices(this RGBSurface surface)
Parameters
Type | Name | Description |
---|---|---|
RGBSurface | surface |
Attach(RGBSurface, IEnumerable<IRGBDevice>)
Attaches the specified devices to the surface.
Declaration
public static void Attach(this RGBSurface surface, IEnumerable<IRGBDevice> devices)
Parameters
Type | Name | Description |
---|---|---|
RGBSurface | surface | The surface the devices are attached to. |
IEnumerable<IRGBDevice> | devices | The devices to attach. |
Detach(RGBSurface, IEnumerable<IRGBDevice>)
Detaches the specified devices from the surface.
Declaration
public static void Detach(this RGBSurface surface, IEnumerable<IRGBDevice> devices)
Parameters
Type | Name | Description |
---|---|---|
RGBSurface | surface | The surface the devices are detached from. |
IEnumerable<IRGBDevice> | devices | The devices to detach. |
GetDevices(RGBSurface, RGBDeviceType)
Gets all devices of the specified RGBDeviceType.
Declaration
public static IEnumerable<IRGBDevice> GetDevices(this RGBSurface surface, RGBDeviceType deviceType)
Parameters
Type | Name | Description |
---|---|---|
RGBSurface | surface | The surface to get the devices from. |
RGBDeviceType | deviceType | The RGBDeviceType of the devices to get. |
Returns
Type | Description |
---|---|
IEnumerable<IRGBDevice> | A collection of devices matching the specified RGBDeviceType. |
GetDevices<T>(RGBSurface)
Gets all devices of a specific type.
Declaration
public static IEnumerable<T> GetDevices<T>(this RGBSurface surface) where T : class
Parameters
Type | Name | Description |
---|---|---|
RGBSurface | surface |
Returns
Type | Description |
---|---|
IEnumerable<T> | A collection of devices with the specified type. |
Type Parameters
Name | Description |
---|---|
T | The type of devices to get. |
Load(RGBSurface, IRGBDeviceProvider, RGBDeviceType, bool)
Initializes the specifiec device provider and attaches all devices.
Declaration
public static void Load(this RGBSurface surface, IRGBDeviceProvider deviceProvider, RGBDeviceType loadFilter = (RGBDeviceType)-1, bool throwExceptions = false)
Parameters
Type | Name | Description |
---|---|---|
RGBSurface | surface | The surface to attach the devices to. |
IRGBDeviceProvider | deviceProvider | The device provider to load. |
RGBDeviceType | loadFilter | RGBDeviceType-flags to filter the devices to load. |
bool | throwExceptions | Specifies if exceptions should be thrown or silently be ignored. |