# EventOccurrence class

Represents a single occurrence of an event.

## Properties

* `DateTime StartDate` - Gets the start date/time of the occurrence
* `DateTime? EndDate` - Gets the end date/time of the occurrence
* `string Title` - Gets the title (name) of the occurrence
* `string Description` - Gets the description of the occurrence
* `string Location` - Gets the location of the occurrence
* `bool IsRecurrent` - Gets whether the occurrence is part of given series of recurrence
* `int Duration` - Gets the duration of the occurrence
* `Event Event` - Gets the event to which this occurrence applies

## Methods

As the class implements the `ICustomTypeDescriptor` interface thee are methods that come from the implementation:

* `AttributeCollection GetAttributes()` - Returns a collection of custom attributes for this instance of a component.
* `string GetClassName()`  – Returns the class name of this instance of a component.
* `string GetComponentName()` - Returns the name of this instance of a component.
* `TypeConverter GetConverter()` - Returns a type converter for this instance of a component.
* `EventDescriptor GetDefaultEvent()` - Returns the default event for this instance of a component.
* `PropertyDescriptor GetDefaultProperty()` - Returns the default property for this instance of a component.
* `object GetEditor(Type editorBaseType)`  - Returns an editor of the specified type for this instance of a component.
* `EventDescriptorCollection GetEvents(Attribute[] attributes)` – Returns the events for this instance of a component using the specified attribute array as a filter.
* `EventDescriptorCollection GetEvents()`  - Returns the events for this instance of a component.
* `PropertyDescriptorCollection GetProperties(Attribute[] attributes)` – Returns the properties for this instance of a component using the attribute array as a filter.
* `PropertyDescriptorCollection GetProperties()` - Returns the properties for this instance of a component.
* `object GetPropertyOwner(PropertyDescriptor pd)` – Returns an object that contains the property described by the specified property descriptor.
* `PropertyDescriptorCollection GetPropertyDescriptorCollection(Attribute[] attributes)` - Returns the properties for this instance of a component using the attribute array as a filter.

Following is an example of the usage of some the `EventOccurence` properties in the `RadSchedulerService`:

```C#
using Telerik.Sitefinity.Modules.Events;
using Telerik.Web.UI;

namespace SitefinityWebApp
{
    public class EventOccurrenceProperties
    {
        private AppointmentData GetAppointment(EventOccurrence occurence)
        {
            var ocurenceEndDate = occurence.EndDate.HasValue == true ? occurence.EndDate.Value : occurence.StartDate.AddMinutes(occurence.Duration);

            var appointment = new AppointmentData()
            {
                Start = occurence.StartDate,
                End = ocurenceEndDate,
                Subject = occurence.Title,
                ID = occurence.Event.Id,
                RecurrenceState = occurence.Event.IsRecurrent ? RecurrenceState.Occurrence : RecurrenceState.NotRecurring,
                Description = occurence.Description,
                Visible = true,
                TimeZoneID = "UTC"
            };

            appointment.Attributes["CalendarColor"] = occurence.Event.Parent.Color;

            if (occurence.Event.AllDayEvent)
            {
                appointment.Attributes["AllDay"] = "true";
            }

            return appointment;
        }
    }
}
```
