CalendarComponent Class
A component of an iCalendar object (BEGIN:NAME ... END:NAME): its properties, in their order, and its components. The typed components (VEvent, VTodo, VTimeZone) read and write their properties through it, so that a component written back keeps the properties they do not know.
public class CalendarComponentConstructors
| Name | Description |
|---|---|
| CalendarComponent(string) | Creates a component. |
CalendarComponent(string)
CalendarComponent.csProperties
| Name | Description |
|---|---|
| Calendar | Gets the calendar the component is in, when it was read from one or added to one. |
| Components | Gets the components, such as the events of a calendar or the alarms of an event. |
| Name | Gets the name of the component. |
| Properties | Gets the properties. |
Calendar
CalendarComponent.csGets the calendar the component is in, when it was read from one or added to one.
public VCalendar? Calendar { get; }Property value
Components
CalendarComponent.csGets the components, such as the events of a calendar or the alarms of an event.
public IList<CalendarComponent> Components { get; }Property value
Properties
CalendarComponent.csMethods
| Name | Description |
|---|---|
| GetDateTime(string) | Returns the date or the date and time of a property. |
| GetProperties(string) | Returns the properties of a name. |
| GetProperty(string) | Returns the first property of a name. |
| GetText(string) | Returns the text of a property, decoded. |
| RemoveProperties(string) | Removes the properties of a name. |
| SetDateTime(string, CalendarDateTime?) | Sets the date or the date and time of a property, or removes it. |
| SetText(string, string?) | Sets the text of a property, or removes the properties of this name when the value is null. |
| SetValue(string, string?) | Sets the value of a property, as it is written, or removes the properties of this name when the value is null. |
| ToString() | Returns the component as it is written, with CRLF line breaks. |
GetDateTime(string)
CalendarComponent.csReturns the date or the date and time of a property.
public CalendarDateTime? GetDateTime(string name)Parameters
namestring- The name of the property, such as
DTSTART.
Returns
CalendarDateTime? The value, or null when the component does not have the property or its value is not a date.
GetProperties(string)
CalendarComponent.csReturns the properties of a name.
public IEnumerable<ContentLine> GetProperties(string name)GetProperty(string)
CalendarComponent.csReturns the first property of a name.
public ContentLine? GetProperty(string name)GetText(string)
CalendarComponent.csRemoveProperties(string)
CalendarComponent.csSetDateTime(string, CalendarDateTime?)
CalendarComponent.csSets the date or the date and time of a property, or removes it.
public void SetDateTime(string name, CalendarDateTime? value)Parameters
namestring- The name of the property.
valueCalendarDateTime?- The value.