Show / Hide Table of Contents

Class LedMapping<T>

Represents a mapping from LedId to a custom identifier.

Inheritance
object
LedMapping<T>
Implements
IEnumerable<(LedId ledId, T mapping)>
IEnumerable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: RGB.NET.Core
Assembly: RGB.NET.Core.dll
Syntax
public sealed class LedMapping<T> : IEnumerable<(LedId ledId, T mapping)>, IEnumerable where T : notnull
Type Parameters
Name Description
T

The identifier the LedId is mapped to.

Properties

| Edit this page View Source

Count

Gets the number of entries in this mapping.

Declaration
public int Count { get; }
Property Value
Type Description
int
| Edit this page View Source

Empty

Declaration
public static LedMapping<T> Empty { get; }
Property Value
Type Description
LedMapping<T>
| Edit this page View Source

this[LedId]

Gets the custom identifier mapped to the specified LedId.

Declaration
public T this[LedId ledId] { get; set; }
Parameters
Type Name Description
LedId ledId

The led id to get the mapped identifier.

Property Value
Type Description
T

The mapped ifentifier.

| Edit this page View Source

this[T]

Gets the LedId mapped to the specified custom identifier.

Declaration
public LedId this[T mapping] { get; set; }
Parameters
Type Name Description
T mapping

The custom identifier to get the mapped led id.

Property Value
Type Description
LedId

The led id.

| Edit this page View Source

LedIds

Gets a collection of all mapped ledids.

Declaration
public ICollection<LedId> LedIds { get; }
Property Value
Type Description
ICollection<LedId>
| Edit this page View Source

Mappings

Gets a collection of all mapped custom identifiers.

Declaration
public ICollection<T> Mappings { get; }
Property Value
Type Description
ICollection<T>

Methods

| Edit this page View Source

Add(LedId, T)

Adds a new entry to the mapping.

Declaration
public void Add(LedId ledId, T mapping)
Parameters
Type Name Description
LedId ledId

The LedId to map.

T mapping

The custom identifier to map.

| Edit this page View Source

Clear()

Removes all registered mappings.

Declaration
public void Clear()
| Edit this page View Source

Contains(LedId)

Checks if the specified LedId is mapped.

Declaration
public bool Contains(LedId ledId)
Parameters
Type Name Description
LedId ledId

The led id to check.

Returns
Type Description
bool

true if the led id is mapped; otherwise false.

| Edit this page View Source

Contains(T)

Checks if the specified custom identifier is mapped.

Declaration
public bool Contains(T mapping)
Parameters
Type Name Description
T mapping

The custom identifier to check.

Returns
Type Description
bool

true if the led id is mapped; otherwise false.

| Edit this page View Source

GetEnumerator()

Returns an enumerator that iterates through the collection.

Declaration
public IEnumerator<(LedId ledId, T mapping)> GetEnumerator()
Returns
Type Description
IEnumerator<(LedId ledId, T mapping)>

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

| Edit this page View Source

Remove(LedId)

Removes the specified led id and the mapped custom identifier.

Declaration
public bool Remove(LedId ledId)
Parameters
Type Name Description
LedId ledId

The led id to remove.

Returns
Type Description
bool

true if there was a mapping for the led id to remove; otherwise false.

| Edit this page View Source

Remove(T)

Removes the specified custom identifier and the mapped led id.

Declaration
public bool Remove(T mapping)
Parameters
Type Name Description
T mapping

The custom identifier to remove.

Returns
Type Description
bool

true if there was a mapping for the custom identifier to remove; otherwise false.

| Edit this page View Source

TryGetValue(LedId, out T?)

Gets the custom identifier mapped to the specified led id.

Declaration
public bool TryGetValue(LedId ledId, out T? mapping)
Parameters
Type Name Description
LedId ledId

The led id to get the custom identifier for.

T mapping

Contains the mapped custom identifier or null if there is no mapping for the specified led id.

Returns
Type Description
bool

true if there was a custom identifier for the specified led id; otherwise false.

| Edit this page View Source

TryGetValue(T, out LedId)

Gets the led id mapped to the specified custom identifier.

Declaration
public bool TryGetValue(T mapping, out LedId ledId)
Parameters
Type Name Description
T mapping

The custom identifier to get the led id for.

LedId ledId

Contains the mapped led id or null if there is no mapping for the specified led id.

Returns
Type Description
bool

true if there was a led id for the specified custom identifier; otherwise false.

Implements

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