Table of Contents

Class DebouncedEventArgs<TData>

Namespace
Dorssel.Utilities.Generic
Assembly
Dorssel.Utilities.Debounce.dll

Provides data for the Debounced event.

public class DebouncedEventArgs<TData> : DebouncedEventArgs

Type Parameters

TData
Inheritance
DebouncedEventArgs<TData>
Inherited Members

Constructors

DebouncedEventArgs(long, IReadOnlyList<TData>)

Initializes a new instance of the DebouncedEventArgs<TData> class.

public DebouncedEventArgs(long count, IReadOnlyList<TData> triggerData)

Parameters

count long
The number of triggers accumulated since the previous event was sent.

Must be greater than 0.

Both Trigger() and Trigger(TData) add to the count.
triggerData IReadOnlyList<TData>

Accumulated data from each call to Trigger(TData).

Exceptions

ArgumentOutOfRangeException

Thrown when count is not greater than 0. Thrown when triggerData has more than count items.

DebouncedEventArgs(long, IReadOnlyList<TData>, bool)

Initializes a new instance of the DebouncedEventArgs<TData> class.

protected DebouncedEventArgs(long count, IReadOnlyList<TData> triggerData, bool boundsCheck)

Parameters

count long
The number of triggers accumulated since the previous event was sent.

Must be greater than 0.

Both Trigger() and Trigger(TData) add to the count.
triggerData IReadOnlyList<TData>
Accumulated data from each call to Trigger(TData).
boundsCheck bool
If false, the parameters are not checked to be within their valid range.

Exceptions

ArgumentOutOfRangeException

Thrown when count is not greater than 0. Thrown when triggerData has more than count items.

This exception is not thrown if boundsCheck is false.

Properties

TriggerData

List of data accumulated in this buffered event.

Note that the trigger data is shared with all event listeners and that besides the list itself (which is read only), the data within the list should probably also not be altered.

public IReadOnlyList<TData> TriggerData { get; }

Property Value

IReadOnlyList<TData>