Show / Hide Table of Contents

Class HIDLoader<TLed, TData>

Represents a loaded for HID-devices based on the specified definitions.

Inheritance
object
HIDLoader<TLed, TData>
Implements
IEnumerable<HIDDeviceDefinition<TLed, TData>>
IEnumerable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: RGB.NET.HID
Assembly: RGB.NET.HID.dll
Syntax
public sealed class HIDLoader<TLed, TData> : IEnumerable<HIDDeviceDefinition<TLed, TData>>, IEnumerable where TLed : notnull
Type Parameters
Name Description
TLed

The type of the identifier leds are mapped to.

TData

The type of the custom data added to the HID-device.

Constructors

| Edit this page View Source

HIDLoader(int)

Initializes a new instance of the HIDLoader<TLed, TData> class.

Declaration
public HIDLoader(int vendorId)
Parameters
Type Name Description
int vendorId

The vendor id used for this loader.

Properties

| Edit this page View Source

LoadFilter

Gets or sets the filter used to determine which devices should be loaded.

Declaration
public RGBDeviceType LoadFilter { get; set; }
Property Value
Type Description
RGBDeviceType
| Edit this page View Source

VendorId

Gets the vendor id used for this loader.

Declaration
public int VendorId { get; }
Property Value
Type Description
int

Methods

| Edit this page View Source

Add(int, RGBDeviceType, string, LedMapping<TLed>, TData)

Adds a new HIDDeviceDefinition<TLed, TData> to this loader.

Declaration
public void Add(int productId, RGBDeviceType deviceType, string name, LedMapping<TLed> ledMapping, TData customData)
Parameters
Type Name Description
int productId

The product id of the HID-device.

RGBDeviceType deviceType

The type of the device.

string name

The name of the device.

LedMapping<TLed> ledMapping

The mapping of the leds of the device.

TData customData

Some custom data to attach to the device.

| Edit this page View Source

GetConnectedDevices()

Gets a enumerable containing all devices from the definition-list that are connected and match the LoadFilter.

Declaration
public IEnumerable<(HIDDeviceDefinition<TLed, TData> definition, HidDevice device)> GetConnectedDevices()
Returns
Type Description
IEnumerable<(HIDDeviceDefinition<TLed, TData> definition, HidDevice device)>

The enumerable containing the connected devices.

| Edit this page View Source

GetConnectedDevices<TKey>(Func<HIDDeviceDefinition<TLed, TData>, TKey>)

Gets a enumerable containing all the first device of each group of devices from the definition-list that are connected and match the LoadFilter. The grouping is done by the specified function.

Declaration
public IEnumerable<(HIDDeviceDefinition<TLed, TData> definition, HidDevice device)> GetConnectedDevices<TKey>(Func<HIDDeviceDefinition<TLed, TData>, TKey> groupBy)
Parameters
Type Name Description
Func<HIDDeviceDefinition<TLed, TData>, TKey> groupBy

The function grouping the devices.

Returns
Type Description
IEnumerable<(HIDDeviceDefinition<TLed, TData> definition, HidDevice device)>

The enumerable containing the selected devices.

Type Parameters
Name Description
TKey

The type of the key used to group the devices.

| Edit this page View Source

GetEnumerator()

Returns an enumerator that iterates through the collection.

Declaration
public IEnumerator<HIDDeviceDefinition<TLed, TData>> GetEnumerator()
Returns
Type Description
IEnumerator<HIDDeviceDefinition<TLed, TData>>

An enumerator that can be used to iterate through the collection.

Implements

IEnumerable<T>
IEnumerable
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX