AdjustmentHandlerContext Class
Definition
- Namespace
- Bodu.Globalization.Calendar
- Assembly
- Bodu.Globalization.Calendar.dll
- Package
- Bodu.Globalization.Calendar 1.0.1
Provides an IAdjustmentHandler with the information needed to compute an observed date: the calculated occurrence date, the requesting territory, the firing policy, and access to the surrounding resolution context.
public sealed class AdjustmentHandlerContext
- Inheritance
-
AdjustmentHandlerContext
- Inherited Members
- Extension Methods
Constructors
AdjustmentHandlerContext(DateOnly, string, AdjustmentPolicy, Func<DateOnly, bool>, StrategyResolutionContext)
Initializes a new instance of the AdjustmentHandlerContext class.
public AdjustmentHandlerContext(DateOnly baseDate, string territory, AdjustmentPolicy policy, Func<DateOnly, bool> isOccupied, StrategyResolutionContext resolutionContext)
Parameters
baseDateDateOnlyThe calculated (actual) occurrence date.
territorystringThe territory code the resolution was requested for.
policyAdjustmentPolicyThe adjustment policy whose custom action is firing.
isOccupiedFunc<DateOnly, bool>A predicate reporting whether a candidate day is already claimed.
resolutionContextStrategyResolutionContextThe resolution context used to resolve referenced rules.
Exceptions
- ArgumentNullException
territory,policy,isOccupied, orresolutionContextis null.
Properties
BaseDate
Gets the calculated (actual) occurrence date the handler adjusts.
public DateOnly BaseDate { get; }
Property Value
- DateOnly
The calculated date.
Parameters
Gets the author-supplied parameters declared by the policy.
public IReadOnlyDictionary<string, string> Parameters { get; }
Property Value
- IReadOnlyDictionary<string, string>
The policy's HandlerParameters; empty when none are declared.
Policy
Gets the adjustment policy whose custom action is firing.
public AdjustmentPolicy Policy { get; }
Property Value
- AdjustmentPolicy
The firing AdjustmentPolicy.
ResolutionContext
Gets the resolution context the handler can use to resolve referenced rules for the same year.
public StrategyResolutionContext ResolutionContext { get; }
Property Value
Territory
Gets the territory code the resolution was requested for.
public string Territory { get; }
Property Value
- string
The requested territory code.
Methods
IsOccupied(DateOnly)
Determines whether a candidate day is already claimed by another non-working occurrence.
public bool IsOccupied(DateOnly date)
Parameters
dateDateOnlyThe candidate day to test.
Returns
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |