Table of Contents

AdjustmentTriggerHandlerRegistry Class

Definition

Namespace
Bodu.Globalization.Calendar
Assembly
Bodu.Globalization.Calendar.dll
Package
Bodu.Globalization.Calendar 1.0.1
Source
AdjustmentTriggerHandlerRegistry.cs

A mutable registry of custom IAdjustmentTriggerHandler implementations keyed by handler key.

public sealed class AdjustmentTriggerHandlerRegistry : IAdjustmentTriggerHandlerRegistry
Inheritance
AdjustmentTriggerHandlerRegistry
Implements
Inherited Members
Extension Methods

Remarks

Keys are matched ordinally and are case-sensitive. Registering a key that is already present replaces the previous handler.

Constructors

AdjustmentTriggerHandlerRegistry()

public AdjustmentTriggerHandlerRegistry()

Methods

Contains(string)

Determines whether a handler is registered under the supplied key.

public bool Contains(string key)

Parameters

key string

The handler key.

Returns

bool

true if a handler is registered; otherwise false.

Exceptions

ArgumentNullException

key is null.

Register(string, IAdjustmentTriggerHandler)

Registers a handler under a key, replacing any existing registration.

public AdjustmentTriggerHandlerRegistry Register(string key, IAdjustmentTriggerHandler handler)

Parameters

key string

The handler key the policy references.

handler IAdjustmentTriggerHandler

The handler implementation.

Returns

AdjustmentTriggerHandlerRegistry

The same registry, to allow chaining.

Exceptions

ArgumentNullException

key or handler is null.

TryGet(string, out IAdjustmentTriggerHandler?)

Attempts to retrieve the handler registered under the supplied key.

public bool TryGet(string key, out IAdjustmentTriggerHandler? handler)

Parameters

key string

The handler key.

handler IAdjustmentTriggerHandler

When this method returns, the registered handler, or null when none.

Returns

bool

true if a handler was found; otherwise false.

Exceptions

ArgumentNullException

key is null.

Applies to

ProductVersions
.NET8, 10