Table of Contents

NotableDateRule Class

Definition

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

Represents one way of calculating a notable-date concept: an applicability scope, exactly one occurrence source (a single-date calculation strategy or a recurrence strategy), an optional duration, and the adjustment policies that transform its occurrences.

public sealed class NotableDateRule
Inheritance
NotableDateRule
Inherited Members
Extension Methods

Remarks

A rule is identified within its notable-date concept by its Id. Optional Category, NonWorking, and Duration values override the inherited defaults of the parent concept; when null the parent value applies.

A rule declares exactly one occurrence source: either a single-date Strategy that yields at most one occurrence per year, or a Recurrence strategy that yields many occurrences within a window. Exactly one of the two is non-null.

Constructors

NotableDateRule(string, int, NotableDateCategory?, bool?, NotableDateDurationDefinition?, RuleApplicability, IDateCalculationStrategy, IEnumerable<string>, IEnumerable<string>)

Initializes a new instance of the NotableDateRule class with a single-date calculation strategy.

public NotableDateRule(string id, int priority, NotableDateCategory? category, bool? nonWorking, NotableDateDurationDefinition? duration, RuleApplicability applicability, IDateCalculationStrategy strategy, IEnumerable<string> adjustmentPolicyRefs, IEnumerable<string> tags)

Parameters

id string

The stable identifier of the rule within its notable-date concept.

priority int

The selection priority of the rule.

category NotableDateCategory?

The category override, or null to inherit the concept's category.

nonWorking bool?

The non-working-day override, or null to inherit the concept's default.

duration NotableDateDurationDefinition

The duration override, or null to inherit the concept's default.

applicability RuleApplicability

The territory, calendar, and year applicability of the rule.

strategy IDateCalculationStrategy

The single-date calculation strategy of the rule.

adjustmentPolicyRefs IEnumerable<string>

The identifiers of the adjustment policies applied to the rule.

tags IEnumerable<string>

The rule-specific tags.

Exceptions

ArgumentNullException

id, applicability, strategy, adjustmentPolicyRefs, or tags is null.

NotableDateRule(string, int, NotableDateCategory?, bool?, NotableDateDurationDefinition?, RuleApplicability, IDateRecurrenceStrategy, IEnumerable<string>, IEnumerable<string>)

Initializes a new instance of the NotableDateRule class with a recurrence strategy.

public NotableDateRule(string id, int priority, NotableDateCategory? category, bool? nonWorking, NotableDateDurationDefinition? duration, RuleApplicability applicability, IDateRecurrenceStrategy recurrence, IEnumerable<string> adjustmentPolicyRefs, IEnumerable<string> tags)

Parameters

id string

The stable identifier of the rule within its notable-date concept.

priority int

The selection priority of the rule.

category NotableDateCategory?

The category override, or null to inherit the concept's category.

nonWorking bool?

The non-working-day override, or null to inherit the concept's default.

duration NotableDateDurationDefinition

The duration override, or null to inherit the concept's default.

applicability RuleApplicability

The territory, calendar, and year applicability of the rule.

recurrence IDateRecurrenceStrategy

The recurrence strategy of the rule.

adjustmentPolicyRefs IEnumerable<string>

The identifiers of the adjustment policies applied to the rule.

tags IEnumerable<string>

The rule-specific tags.

Exceptions

ArgumentNullException

id, applicability, recurrence, adjustmentPolicyRefs, or tags is null.

Properties

AdjustmentPolicyRefs

Gets the identifiers of the adjustment policies applied to the rule.

public IReadOnlyList<string> AdjustmentPolicyRefs { get; }

Property Value

IReadOnlyList<string>

The referenced policy ids; empty when the rule has no adjustments.

Applicability

Gets the territory, calendar, and year applicability of the rule.

public RuleApplicability Applicability { get; }

Property Value

RuleApplicability

The RuleApplicability.

Category

Gets the category override of the rule.

public NotableDateCategory? Category { get; }

Property Value

NotableDateCategory?

The category, or null when the concept's category is inherited.

Duration

Gets the duration override of the rule.

public NotableDateDurationDefinition? Duration { get; }

Property Value

NotableDateDurationDefinition

The duration definition, or null when the concept's default duration is inherited.

DurationDays

Gets the explicit fixed-duration override of the rule, in days.

public int? DurationDays { get; }

Property Value

int?

The fixed duration in days when the rule declares a fixed duration; otherwise null (the concept default is inherited, or the rule uses a calculated end-date duration).

Id

Gets the stable identifier of the rule within its notable-date concept.

public string Id { get; }

Property Value

string

The rule id.

NonWorking

Gets the non-working-day override of the rule.

public bool? NonWorking { get; }

Property Value

bool?

The flag, or null when the concept's default is inherited.

Priority

Gets the selection priority of the rule.

public int Priority { get; }

Property Value

int

The numeric priority.

Recurrence

Gets the recurrence strategy of the rule.

public IDateRecurrenceStrategy? Recurrence { get; }

Property Value

IDateRecurrenceStrategy

The IDateRecurrenceStrategy, or null when the rule uses a single-date strategy.

Strategy

Gets the single-date calculation strategy of the rule.

public IDateCalculationStrategy? Strategy { get; }

Property Value

IDateCalculationStrategy

The IDateCalculationStrategy, or null when the rule uses a recurrence source.

Tags

Gets the rule-specific tags.

public IReadOnlyList<string> Tags { get; }

Property Value

IReadOnlyList<string>

The tags; empty when the rule declares none.

Applies to

ProductVersions
.NET8, 10

See Also