AdjustmentHandlerRegistry Class
Definition
- Namespace
- Bodu.Globalization.Calendar
- Assembly
- Bodu.Globalization.Calendar.dll
- Package
- Bodu.Globalization.Calendar 1.0.1
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
keystringThe handler key.
Returns
Exceptions
- ArgumentNullException
keyis null.
Register(string, IAdjustmentHandler)
Registers a handler under a key, replacing any existing registration.
public AdjustmentHandlerRegistry Register(string key, IAdjustmentHandler handler)
Parameters
keystringThe handler key the policy references.
handlerIAdjustmentHandlerThe handler implementation.
Returns
- AdjustmentHandlerRegistry
The same registry, to allow chaining.
Exceptions
- ArgumentNullException
keyorhandleris null.
TryGet(string, out IAdjustmentHandler?)
Attempts to retrieve the handler registered under the supplied key.
public bool TryGet(string key, out IAdjustmentHandler? handler)
Parameters
keystringThe handler key.
handlerIAdjustmentHandlerWhen this method returns, the registered handler, or null when none.
Returns
Exceptions
- ArgumentNullException
keyis null.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |