Class AbstractRGBDevice<TDeviceInfo>
Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
Inheritance
Implements
Inherited Members
Namespace: RGB.NET.Core
Assembly: RGB.NET.Core.dll
Syntax
public abstract class AbstractRGBDevice<TDeviceInfo> : Placeable, IRGBDevice<TDeviceInfo>, IRGBDevice, IEnumerable<Led>, IEnumerable, IPlaceable, IBindable, INotifyPropertyChanged, IDisposable where TDeviceInfo : class, IRGBDeviceInfo
Type Parameters
Name | Description |
---|---|
TDeviceInfo |
Constructors
| Edit this page View SourceAbstractRGBDevice(TDeviceInfo, IUpdateQueue)
Initializes a new instance of the AbstractRGBDevice<TDeviceInfo> class.
Declaration
protected AbstractRGBDevice(TDeviceInfo deviceInfo, IUpdateQueue updateQueue)
Parameters
Type | Name | Description |
---|---|---|
TDeviceInfo | deviceInfo | The device info of this device. |
IUpdateQueue | updateQueue | The queue used to update this device. |
Properties
| Edit this page View SourceColorCorrections
Gets a list of color corrections applied to this device.
Declaration
public IList<IColorCorrection> ColorCorrections { get; }
Property Value
Type | Description |
---|---|
IList<IColorCorrection> |
DeviceInfo
Gets generic information about the IRGBDevice.
Declaration
public TDeviceInfo DeviceInfo { get; }
Property Value
Type | Description |
---|---|
TDeviceInfo |
LedMapping
Gets a dictionary containing all Led of the IRGBDevice.
Declaration
protected Dictionary<LedId, Led> LedMapping { get; }
Property Value
Type | Description |
---|---|
Dictionary<LedId, Led> |
RequiresFlush
Gets or sets if the device needs to be flushed on every update.
Declaration
protected bool RequiresFlush { get; set; }
Property Value
Type | Description |
---|---|
bool |
UpdateQueue
Gets the update queue used to update this device.
Declaration
protected IUpdateQueue UpdateQueue { get; }
Property Value
Type | Description |
---|---|
IUpdateQueue |
Methods
| Edit this page View SourceAddLed(LedId, in Point, in Size, object?)
Adds a led to the device.
Declaration
public virtual Led? AddLed(LedId ledId, in Point location, in Size size, object? customData = null)
Parameters
Type | Name | Description |
---|---|---|
LedId | ledId | The id of the led. |
Point | location | The location of the led on the device. |
Size | size | The size of the led. |
object | customData | Custom data saved on the led. |
Returns
Type | Description |
---|---|
Led | The newly added led or |
DeviceUpdate()
Performs device specific updates.
Declaration
protected virtual void DeviceUpdate()
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public virtual void Dispose()
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<Led> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<Led> | An enumerator that can be used to iterate through the collection. |
GetLedCustomData(LedId)
Gets the custom data associated with the specified LED.
Declaration
protected virtual object? GetLedCustomData(LedId ledId)
Parameters
Type | Name | Description |
---|---|---|
LedId | ledId | The id of the led. |
Returns
Type | Description |
---|---|
object | The custom data for the specified LED. |
GetLedsToUpdate(bool)
Gets an enumerable of LEDs that are changed and requires an update.
Declaration
protected virtual IEnumerable<Led> GetLedsToUpdate(bool flushLeds)
Parameters
Type | Name | Description |
---|---|---|
bool | flushLeds | Forces all LEDs to be treated as dirty. |
Returns
Type | Description |
---|---|
IEnumerable<Led> | The collection LEDs to update. |
GetUpdateData(Led)
Gets an enumerable of a custom data and color tuple for the specified leds.
Declaration
protected (object key, Color color) GetUpdateData(Led led)
Parameters
Type | Name | Description |
---|---|---|
Led | led |
Returns
Type | Description |
---|---|
(object key, Color color) | The enumerable of custom data and color tuples for the specified leds. |
Remarks
Applies all ColorCorrections. if no CustomData ist specified the Id is used.
OnAttached()
Called when the device is attached to a surface.
Declaration
protected virtual void OnAttached()
Remarks
When overriden base should be called to validate boundries.
OnDetached()
Called when the device is detached from a surface.
Declaration
protected virtual void OnDetached()
RemoveLed(LedId)
Removes the led with the specified id from the device.
Declaration
public virtual Led? RemoveLed(LedId ledId)
Parameters
Type | Name | Description |
---|---|---|
LedId | ledId | The id of the led to remove. |
Returns
Type | Description |
---|---|
Led | The removed led or |
Update(bool)
Declaration
public virtual void Update(bool flushLeds = false)
Parameters
Type | Name | Description |
---|---|---|
bool | flushLeds | Specifies whether all Led (including clean ones) should be updated. |
UpdateLeds(IEnumerable<Led>)
Sends all the updated Led to the device.
Declaration
protected virtual void UpdateLeds(IEnumerable<Led> ledsToUpdate)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Led> | ledsToUpdate |