Method AmendedWith
- Namespace
- MailFathom.Domain.Calendar
- Assembly
- MailFathom.Domain.dll
AmendedWith(CalendarEventTitle, DateTimeOffset, DateTimeOffset?, bool, IReadOnlyCollection<Reminder>, DateTimeOffset)
Produces this event with what an amendment replaced, keeping its identity, its origin, and where it came from.
public CalendarEvent AmendedWith(CalendarEventTitle title, DateTimeOffset start, DateTimeOffset? end, bool isAllDay, IReadOnlyCollection<Reminder> reminders, DateTimeOffset amendedAt)
Parameters
titleCalendarEventTitleWhat the event is called after the amendment.
startDateTimeOffsetWhen it begins after the amendment.
endDateTimeOffset?When it ends after the amendment, or null to hold no end.
isAllDayboolWhether it is stated as a day rather than as a clock time afterwards.
remindersIReadOnlyCollection<Reminder>The leads it is to be announced at afterwards, or empty to announce nothing.
amendedAtDateTimeOffsetWhen the amendment happened.
Returns
- CalendarEvent
The amended event.
Remarks
An amendment states the event as it is to stand rather than the difference from the one held, which is what keeps retitling it, moving it, dropping its end, and changing what announces it one operation instead of four that each pass through a shape the invariants above refuse. The reminders are part of that record for the same reason: a person turning the last one off is stating an event that announces nothing rather than omitting a field.
Exceptions
- ArgumentNullException
Thrown when
remindersis null.- ArgumentOutOfRangeException
Thrown when
endis not afterstart, or when more than MaximumCount reminders are supplied.- ArgumentException
Thrown when
titleis the default of its type, or when one lead is supplied twice.