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
idstringThe stable identifier of the concept.
displayNamestringThe human-readable name of the concept.
categoryNotableDateCategoryThe default category inherited by child rules.
defaultNonWorkingDayboolThe default non-working-day flag inherited by child rules.
defaultDurationDaysintThe default duration in days inherited by child rules.
tagsIEnumerable<string>The tags inherited by child rules unless overridden.
rulesIEnumerable<NotableDateRule>The calculation rules belonging to the concept.
Exceptions
- ArgumentNullException
id,displayName,tags, orrulesis 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
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
rulesIEnumerable<NotableDateRule>The replacement rules.
Returns
- NotableDateDefinition
A new NotableDateDefinition with identical metadata and the supplied rules.
Exceptions
- ArgumentNullException
rulesis null.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |