FixedDurationDefinition Class
Definition
- Namespace
- Bodu.Globalization.Calendar
- Assembly
- Bodu.Globalization.Calendar.dll
- Package
- Bodu.Globalization.Calendar 1.0.1
Represents a fixed occurrence duration expressed as a number of calendar days, inclusive of the occurrence start date.
public sealed record FixedDurationDefinition : NotableDateDurationDefinition, IEquatable<NotableDateDurationDefinition>, IEquatable<FixedDurationDefinition>
- Inheritance
-
FixedDurationDefinition
- Implements
- Inherited Members
- Extension Methods
Remarks
A fixed duration of one day is a single-day occurrence. The resolved end date is
Date + Days - 1. Values below one are clamped to one at resolution time.
Constructors
FixedDurationDefinition(int)
Represents a fixed occurrence duration expressed as a number of calendar days, inclusive of the occurrence start date.
public FixedDurationDefinition(int Days)
Parameters
DaysintThe number of calendar days the occurrence spans, inclusive of the first day.
Remarks
A fixed duration of one day is a single-day occurrence. The resolved end date is
Date + Days - 1. Values below one are clamped to one at resolution time.
- See Also
Properties
Days
The number of calendar days the occurrence spans, inclusive of the first day.
public int Days { get; init; }
Property Value
EqualityContract
protected override Type EqualityContract { get; }
Property Value
Methods
Deconstruct(out int)
public void Deconstruct(out int Days)
Parameters
Daysint
Equals(FixedDurationDefinition?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(FixedDurationDefinition? other)
Parameters
otherFixedDurationDefinitionAn object to compare with this object.
Returns
Equals(NotableDateDurationDefinition?)
Indicates whether the current object is equal to another object of the same type.
public override sealed bool Equals(NotableDateDurationDefinition? other)
Parameters
otherNotableDateDurationDefinitionAn object to compare with this object.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
PrintMembers(StringBuilder)
protected override bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Operators
operator ==(FixedDurationDefinition?, FixedDurationDefinition?)
public static bool operator ==(FixedDurationDefinition? left, FixedDurationDefinition? right)
Parameters
leftFixedDurationDefinitionrightFixedDurationDefinition
Returns
operator !=(FixedDurationDefinition?, FixedDurationDefinition?)
public static bool operator !=(FixedDurationDefinition? left, FixedDurationDefinition? right)
Parameters
leftFixedDurationDefinitionrightFixedDurationDefinition
Returns
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |