Table of Contents

AdjustmentHandlerRegistry Class

Definition

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

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

public sealed class AdjustmentHandlerRegistry : IAdjustmentHandlerRegistry
Inheritance
AdjustmentHandlerRegistry
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

AdjustmentHandlerRegistry()

public AdjustmentHandlerRegistry()

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, IAdjustmentHandler)

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

public AdjustmentHandlerRegistry Register(string key, IAdjustmentHandler handler)

Parameters

key string

The handler key the policy references.

handler IAdjustmentHandler

The handler implementation.

Returns

AdjustmentHandlerRegistry

The same registry, to allow chaining.

Exceptions

ArgumentNullException

key or handler is null.

TryGet(string, out IAdjustmentHandler?)

Attempts to retrieve the handler registered under the supplied key.

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

Parameters

key string

The handler key.

handler IAdjustmentHandler

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