Event Class
Represents a calendar event with scheduling information.
public sealed class EventRemarks
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
| Name | Description |
|---|---|
| Event() |
Event()
Event.cspublic Event()No documentation is available.
Properties
| Name | Description |
|---|---|
| AdditionalProperties | Gets additional custom properties for the event, each value written according to the value type of its property. |
| Attendees | Gets the attendees for the event. |
| Created | Gets or sets the date and time when the event was created. |
| CreatedParameters | Gets the parameters of the CREATED property, VALUE and TZID excepted. |
| DateTimeStamp | Gets or sets the date and time stamp for the event. |
| DateTimeStampParameters | Gets the parameters of the DTSTAMP property, VALUE and TZID excepted. |
| Description | Gets or sets the event description. |
| DescriptionParameters | Gets the parameters of the DESCRIPTION property, such as LANGUAGE or ALTREP. |
| End | Gets or sets the end date and time of the event. |
| EndParameters | Gets the parameters of the DTEND property, or of the DURATION property the end is read from and written with, VALUE and TZID excepted. |
| Id | Gets or sets the unique identifier for the event. |
| IdParameters | Gets the parameters of the UID property. |
| IsAllDay | Gets or sets a value indicating whether Event.Start and Event.End denote whole days rather than instants. |
| LastModified | Gets or sets the date and time when the event was last modified. |
| LastModifiedParameters | Gets the parameters of the LAST-MODIFIED property, VALUE and TZID excepted. |
| Organizer | Gets or sets the event organizer. |
| RawProperties | Gets the properties of the event that are written verbatim, in order, after Event.AdditionalProperties. |
| RecurrenceRule | Gets or sets the recurrence rule for repeating events. |
| RecurrenceRuleParameters | Gets the parameters of the RRULE property. |
| Start | Gets or sets the start date and time of the event. |
| StartParameters | Gets the parameters of the DTSTART property, VALUE and TZID excepted. |
| Status | Gets or sets the status of the event. |
| StatusParameters | Gets the parameters of the STATUS property. |
| Summary | Gets or sets the event summary or title. |
| SummaryParameters | Gets the parameters of the SUMMARY property, such as LANGUAGE or ALTREP. |
| TimeZone | Gets or sets the time zone Event.Start and Event.End are expressed in. |
AdditionalProperties
Event.csGets 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
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.csGets the attendees for the event.
Created
Event.csGets or sets the date and time when the event was created.
public DateTime Created { get; set; }Property value
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.csGets the parameters of the CREATED property, VALUE and TZID excepted.
public IList<KeyValuePair<string, string>> CreatedParameters { get; }Property value
DateTimeStamp
Event.csGets or sets the date and time stamp for the event.
public DateTime DateTimeStamp { get; set; }Property value
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.csGets the parameters of the DTSTAMP property, VALUE and TZID excepted.
public IList<KeyValuePair<string, string>> DateTimeStampParameters { get; }Property value
Description
Event.csDescriptionParameters
Event.csGets the parameters of the DESCRIPTION property, such as LANGUAGE or ALTREP.
public IList<KeyValuePair<string, string>> DescriptionParameters { get; }Property value
End
Event.csGets or sets the end date and time of the event.
public DateTime End { get; set; }Property value
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.csGets 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; }Property value
Id
Event.csIdParameters
Event.csGets the parameters of the UID property.
public IList<KeyValuePair<string, string>> IdParameters { get; }Property value
IsAllDay
Event.csGets or sets a value indicating whether Event.Start and Event.End denote whole days rather than instants.
public bool IsAllDay { get; set; }Property value
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.csGets or sets the date and time when the event was last modified.
public DateTime LastModified { get; set; }Property value
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.csGets the parameters of the LAST-MODIFIED property, VALUE and TZID excepted.
public IList<KeyValuePair<string, string>> LastModifiedParameters { get; }Property value
Organizer
Event.csGets or sets the event organizer.
public Organizer? Organizer { get; set; }RawProperties
Event.csGets 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.csGets or sets the recurrence rule for repeating events.
public RecurrenceRule? RecurrenceRule { get; set; }Property value
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.csGets the parameters of the RRULE property.
public IList<KeyValuePair<string, string>> RecurrenceRuleParameters { get; }Property value
Start
Event.csStartParameters
Event.csGets the parameters of the DTSTART property, VALUE and TZID excepted.
public IList<KeyValuePair<string, string>> StartParameters { get; }Property value
Status
Event.csGets or sets the status of the event.
public EventStatus? Status { get; set; }Property value
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.csGets the parameters of the STATUS property.
public IList<KeyValuePair<string, string>> StatusParameters { get; }Property value
Summary
Event.csSummaryParameters
Event.csGets the parameters of the SUMMARY property, such as LANGUAGE or ALTREP.
public IList<KeyValuePair<string, string>> SummaryParameters { get; }Property value
TimeZone
Event.csGets or sets the time zone Event.Start and Event.End are expressed in.
public TimeZoneInfo? TimeZone { get; set; }Property value
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.