Event Class

Represents a calendar event with scheduling information.

public sealed class Event

Remarks

The ...Parameters collections hold the parameters of the properties the event is written with, in the form Attendee.Parameters describes. They are validated as they are added, filled in order by the parser, and written only with their property. The writer sets the VALUE and TZID parameters of a date-time property itself, so the parser does not store them and the writer skips them.

Constructors

NameDescription
Event()

Event()

Event.cs
public Event()

No documentation is available.

Properties

NameDescription
AdditionalPropertiesGets additional custom properties for the event, each value written according to the value type of its property.
AttendeesGets the attendees for the event.
CreatedGets or sets the date and time when the event was created.
CreatedParametersGets the parameters of the CREATED property, VALUE and TZID excepted.
DateTimeStampGets or sets the date and time stamp for the event.
DateTimeStampParametersGets the parameters of the DTSTAMP property, VALUE and TZID excepted.
DescriptionGets or sets the event description.
DescriptionParametersGets the parameters of the DESCRIPTION property, such as LANGUAGE or ALTREP.
EndGets or sets the end date and time of the event.
EndParametersGets the parameters of the DTEND property, or of the DURATION property the end is read from and written with, VALUE and TZID excepted.
IdGets or sets the unique identifier for the event.
IdParametersGets the parameters of the UID property.
IsAllDayGets or sets a value indicating whether Event.Start and Event.End denote whole days rather than instants.
LastModifiedGets or sets the date and time when the event was last modified.
LastModifiedParametersGets the parameters of the LAST-MODIFIED property, VALUE and TZID excepted.
OrganizerGets or sets the event organizer.
RawPropertiesGets the properties of the event that are written verbatim, in order, after Event.AdditionalProperties.
RecurrenceRuleGets or sets the recurrence rule for repeating events.
RecurrenceRuleParametersGets the parameters of the RRULE property.
StartGets or sets the start date and time of the event.
StartParametersGets the parameters of the DTSTART property, VALUE and TZID excepted.
StatusGets or sets the status of the event.
StatusParametersGets the parameters of the STATUS property.
SummaryGets or sets the event summary or title.
SummaryParametersGets the parameters of the SUMMARY property, such as LANGUAGE or ALTREP.
TimeZoneGets or sets the time zone Event.Start and Event.End are expressed in.

AdditionalProperties

Event.cs

Gets additional custom properties for the event, each value written according to the value type of its property.

public IDictionary<string, string> AdditionalProperties { get; }

Property value

IDictionary<string, string>

Remarks

A property whose value type is TEXT (RFC 5545 section 3.3.11) — an X- property, a property RFC 5545 does not define, or a TEXT property such as LOCATION or CLASS — has its value escaped when written, so it cannot hold a structured value such as a list or a parameter; use Event.RawProperties for those. The value of a property whose value type is not TEXT, such as URL, GEO or EXDATE, is written as is, its control characters dropped.

The parser stores a property here only when it carries no parameter, occurs once, has a single TEXT value, and that value is written back unchanged. See Event.RawProperties.

A property whose name is not a valid property name, or is the name of a property the event is written with (such as DTSTART, UID, SUMMARY or RRULE, and BEGIN or END, and DURATION when Event.End is set), is not written.

Attendees

Event.cs

Gets the attendees for the event.

public IList<Attendee> Attendees { get; }

Property value

IList<Attendee>

Remarks

An attendee without an Attendee.Address is not written.

Created

Event.cs

Gets or sets the date and time when the event was created.

public DateTime Created { get; set; }

Property value

DateTime

Remarks

Written as the CREATED property in UTC, as RFC 5545 section 3.8.7.1 requires: a DateTimeKind.Local value is converted to UTC and a DateTimeKind.Unspecified one is taken as UTC. The property is not written when the value is default(DateTime).

CreatedParameters

Event.cs

Gets the parameters of the CREATED property, VALUE and TZID excepted.

public IList<KeyValuePair<string, string>> CreatedParameters { get; }

DateTimeStamp

Event.cs

Gets or sets the date and time stamp for the event.

public DateTime DateTimeStamp { get; set; }

Property value

DateTime

Remarks

Written as the DTSTAMP property in UTC, as RFC 5545 section 3.8.7.2 requires: a DateTimeKind.Local value is converted to UTC and a DateTimeKind.Unspecified one is taken as UTC. RFC 5545 requires the property in a VEVENT, but it is not written when the value is default(DateTime), so the output does not depend on the current time; set it, for instance to DateTime.UtcNow, to produce a conforming event.

DateTimeStampParameters

Event.cs

Gets the parameters of the DTSTAMP property, VALUE and TZID excepted.

public IList<KeyValuePair<string, string>> DateTimeStampParameters { get; }

Description

Event.cs

Gets or sets the event description.

public string? Description { get; set; }

Property value

string?

Remarks

The DESCRIPTION property is not written when the value is null, which is also what the parser produces for an event without one.

DescriptionParameters

Event.cs

Gets the parameters of the DESCRIPTION property, such as LANGUAGE or ALTREP.

public IList<KeyValuePair<string, string>> DescriptionParameters { get; }

Gets or sets the end date and time of the event.

public DateTime End { get; set; }

Property value

DateTime

Remarks

The DTEND property is not written when the value is default(DateTime).

The parser computes it from DURATION when the event has one (RFC 5545 section 3.3.6): the days and weeks are added to the wall clock of the start and the hours, minutes and seconds to the instant it denotes. The event is then written back with that DURATION rather than DTEND as long as the end still equals the start plus the duration.

EndParameters

Event.cs

Gets the parameters of the DTEND property, or of the DURATION property the end is read from and written with, VALUE and TZID excepted.

public IList<KeyValuePair<string, string>> EndParameters { get; }

Gets or sets the unique identifier for the event.

public string? Id { get; set; }

Property value

string?

IdParameters

Event.cs

Gets the parameters of the UID property.

public IList<KeyValuePair<string, string>> IdParameters { get; }

IsAllDay

Event.cs

Gets or sets a value indicating whether Event.Start and Event.End denote whole days rather than instants.

public bool IsAllDay { get; set; }

Property value

bool

Remarks

When true, only the date part of Event.Start and Event.End is written, as DTSTART;VALUE=DATE:20240101 (RFC 5545 section 3.3.4), whatever their DateTime.Kind, and Event.TimeZone is ignored. As in RFC 5545, Event.End is exclusive: a one-day event on January 1 ends on January 2.

The parser sets it when DTSTART is a DATE value, and reads the date as its first instant.

LastModified

Event.cs

Gets or sets the date and time when the event was last modified.

public DateTime LastModified { get; set; }

Property value

DateTime

Remarks

Written as the LAST-MODIFIED property in UTC, as RFC 5545 section 3.8.7.3 requires: a DateTimeKind.Local value is converted to UTC and a DateTimeKind.Unspecified one is taken as UTC. The property is not written when the value is default(DateTime).

LastModifiedParameters

Event.cs

Gets the parameters of the LAST-MODIFIED property, VALUE and TZID excepted.

public IList<KeyValuePair<string, string>> LastModifiedParameters { get; }

Organizer

Event.cs

Gets or sets the event organizer.

public Organizer? Organizer { get; set; }

Property value

Organizer?

Remarks

An organizer without an Organizer.Address is not written.

RawProperties

Event.cs

Gets the properties of the event that are written verbatim, in order, after Event.AdditionalProperties.

public IList<InternetCalendarProperty> RawProperties { get; }

Property value

IList<InternetCalendarProperty>

Remarks

The parser stores here, as written, every property the model does not represent and that Event.AdditionalProperties does not hold: a property with parameters, a repeated one, one whose value type is not TEXT whatever its value, such as EXDATE:20240104T100000, URL:https://example.com/?q=a,b or CATEGORIES:WORK, or a TEXT value TEXT escaping would not write back unchanged, such as X-LIST:a,b.

A TZID parameter of these properties, as of any other written parameter, makes the calendar carry a matching VTIMEZONE component when the identifier resolves.

A property whose name is the name of a property the event is written with is not written, except RRULE, so an additional recurrence rule the parser read is written back.

RecurrenceRule

Event.cs

Gets or sets the recurrence rule for repeating events.

public RecurrenceRule? RecurrenceRule { get; set; }

Property value

RecurrenceRule?

Remarks

RFC 5545 section 3.3.10 requires UNTIL to have the value type of DTSTART, so the writer converts it, without modifying the rule: to a DATE for an all-day event, to a floating date-time for a floating start, and to a UTC date-time for a start in UTC, in local time or in Event.TimeZone. A floating UNTIL is read in the time zone of the start, a DATE bounds the occurrences through the end of that day, and a date-time becomes a DATE by its date in the frame of the start. An UNTIL whose instant is outside the range of DateTime is written as its first or last UTC value.

The parser reads the first RRULE of the event; RFC 5545 discourages any further one, which goes to Event.RawProperties.

RecurrenceRuleParameters

Event.cs

Gets the parameters of the RRULE property.

public IList<KeyValuePair<string, string>> RecurrenceRuleParameters { get; }

Gets or sets the start date and time of the event.

public DateTime Start { get; set; }

Property value

DateTime

Remarks

The DTSTART property is not written when the value is default(DateTime), which is also what the parser produces for an event without one.

StartParameters

Event.cs

Gets the parameters of the DTSTART property, VALUE and TZID excepted.

public IList<KeyValuePair<string, string>> StartParameters { get; }

Status

Event.cs

Gets or sets the status of the event.

public EventStatus? Status { get; set; }

Property value

EventStatus?

Remarks

The STATUS property is not written when the value is null, which is also what the parser produces for an event without one. A value that is not a member of EventStatus cannot be written, and InternetCalendar.ToIcs throws an InvalidOperationException before writing anything.

StatusParameters

Event.cs

Gets the parameters of the STATUS property.

public IList<KeyValuePair<string, string>> StatusParameters { get; }

Summary

Event.cs

Gets or sets the event summary or title.

public string? Summary { get; set; }

Property value

string?

SummaryParameters

Event.cs

Gets the parameters of the SUMMARY property, such as LANGUAGE or ALTREP.

public IList<KeyValuePair<string, string>> SummaryParameters { get; }

TimeZone

Event.cs

Gets or sets the time zone Event.Start and Event.End are expressed in.

public TimeZoneInfo? TimeZone { get; set; }

Property value

TimeZoneInfo?

Remarks

When set, the two properties are written as DTSTART;TZID= and DTEND;TZID= (RFC 5545 section 3.3.5 form 3), and the calendar carries a matching VTIMEZONE component. When null, they are written as a UTC or a floating date-time, as before.

A value whose DateTime.Kind is DateTimeKind.Unspecified is taken as a wall-clock reading in this time zone. A DateTimeKind.Utc or DateTimeKind.Local value denotes an instant and is converted to this time zone; a local time skipped by a forward transition of the local time zone is read with the offset in effect before the transition, as RFC 5545 section 3.3.5 reads a wall clock.

Event.Created, Event.LastModified and Event.DateTimeStamp are not affected, and the time zone is ignored when Event.IsAllDay is true.