Table of Contents

Class CompositeTracker

Namespace
VpnHood.Net.Toolkit.Trackers
Assembly
VpnHood.Net.Toolkit.dll

Provides several trackers as one: the switch and every event go to each.

public sealed class CompositeTracker : ITracker
Inheritance
CompositeTracker
Implements
Inherited Members

Remarks

A member's failure is logged and keeps the events from no other member; a cancellation is thrown.

Constructors

CompositeTracker(IReadOnlyList<ITracker>, bool)

Provides several trackers as one: the switch and every event go to each.

public CompositeTracker(IReadOnlyList<ITracker> trackers, bool isEnabled)

Parameters

trackers IReadOnlyList<ITracker>

The trackers.

isEnabled bool

Whether the composite sends events; the members keep their own switches until IsEnabled is set.

Remarks

A member's failure is logged and keeps the events from no other member; a cancellation is thrown.

Properties

IsEnabled

Gets or sets a value indicating whether the tracker sends events; off, it drops them.

public bool IsEnabled { get; set; }

Property Value

bool

Remarks

A set goes to every member, and the composite keeps the value it is given, so whoever set it reads back what it set, whatever a member does with it.

Trackers

Gets the trackers.

public IReadOnlyList<ITracker> Trackers { get; }

Property Value

IReadOnlyList<ITracker>

Methods

Track(TrackEvent, CancellationToken)

Sends an event.

public Task Track(TrackEvent trackEvent, CancellationToken cancellationToken)

Parameters

trackEvent TrackEvent

The event.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task

A task that represents the asynchronous operation.

Exceptions

OperationCanceledException

The token was canceled, or a member threw a cancellation.

Track(IEnumerable<TrackEvent>, CancellationToken)

Sends events.

public Task Track(IEnumerable<TrackEvent> trackEvents, CancellationToken cancellationToken)

Parameters

trackEvents IEnumerable<TrackEvent>

The events.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task

A task that represents the asynchronous operation.

Remarks

Off, it sends nothing; on, it sends the events to every member at once.

Exceptions

OperationCanceledException

The token was canceled, or a member threw a cancellation.