Table of Contents

NotableDateDefinition Class

Definition

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

Represents a single notable-date concept: its stable identity, presentation metadata, inherited defaults, and one or more calculation rules.

public sealed class NotableDateDefinition
Inheritance
NotableDateDefinition
Inherited Members
Extension Methods

Remarks

A concept owns multiple rules so that territory-specific variants - for example a national and a regional rule that merely share a display name - coexist as distinct, independently addressable rules rather than collapsing.

Constructors

NotableDateDefinition(string, string, NotableDateCategory, bool, int, IEnumerable<string>, IEnumerable<NotableDateRule>)

Initializes a new instance of the NotableDateDefinition class.

public NotableDateDefinition(string id, string displayName, NotableDateCategory category, bool defaultNonWorkingDay, int defaultDurationDays, IEnumerable<string> tags, IEnumerable<NotableDateRule> rules)

Parameters

id string

The stable identifier of the concept.

displayName string

The human-readable name of the concept.

category NotableDateCategory

The default category inherited by child rules.

defaultNonWorkingDay bool

The default non-working-day flag inherited by child rules.

defaultDurationDays int

The default duration in days inherited by child rules.

tags IEnumerable<string>

The tags inherited by child rules unless overridden.

rules IEnumerable<NotableDateRule>

The calculation rules belonging to the concept.

Exceptions

ArgumentNullException

id, displayName, tags, or rules is null.

Properties

Category

Gets the default category inherited by child rules.

public NotableDateCategory Category { get; }

Property Value

NotableDateCategory

The concept's NotableDateCategory.

DefaultDurationDays

Gets the default duration in days inherited by child rules.

public int DefaultDurationDays { get; }

Property Value

int

The default duration.

DefaultNonWorkingDay

Gets a value indicating whether child rules default to a non-working day.

public bool DefaultNonWorkingDay { get; }

Property Value

bool

true when child rules default to a non-working day; otherwise false.

DisplayName

Gets the human-readable name of the concept.

public string DisplayName { get; }

Property Value

string

The display name.

Id

Gets the stable identifier of the concept.

public string Id { get; }

Property Value

string

The concept id.

Rules

Gets the calculation rules belonging to the concept.

public IReadOnlyList<NotableDateRule> Rules { get; }

Property Value

IReadOnlyList<NotableDateRule>

The rules; may be empty after override removal.

Tags

Gets the tags inherited by child rules unless overridden.

public IReadOnlyList<string> Tags { get; }

Property Value

IReadOnlyList<string>

The concept tags; empty when none are declared.

Methods

WithRules(IEnumerable<NotableDateRule>)

Creates a copy of the concept with its rules replaced.

public NotableDateDefinition WithRules(IEnumerable<NotableDateRule> rules)

Parameters

rules IEnumerable<NotableDateRule>

The replacement rules.

Returns

NotableDateDefinition

A new NotableDateDefinition with identical metadata and the supplied rules.

Exceptions

ArgumentNullException

rules is null.

Applies to

ProductVersions
.NET8, 10

See Also