![]() ![]() ![]() ![]() Gravitybox Schedule Primer
Page 101
1998-2004 Gravitybox Software LLC
Chapter 11
Recurring Appointments
In addition to scheduling single ungrouped appointments, a
group of them may also be added. Appointments in a group
are related in that they have the same GroupId, but the
properties of each may be manipulated separately. When an appointment is created, it
is assigned a unique GroupId. To determine the number of appointments in any group,
you may use the GroupCount method of the ScheduleItems collection. Given a GroupId,
it returns the number of appointments with a matching GroupId. You may
programmatically add recurrences with the AddRecurrence method of the
ScheduleItems collection. Given an existing appointment and a Recurrence object.
The proper number of recurring appointments will be added to the ScheduleItems
collection. In addition to adding recurrences with code there is a provided UI. The
default UI uses the ScheduleRecurrence control. You may wish to not use the default
dialog and instead use this control to create your own dialog for this functionality.
A recurrence object provides all of the necessary information to build a recurrence
pattern. A recurrence pattern may be organized in many different ways. This object has
a StartDate that defines the starting date of the recurring pattern. In addition the pattern
may end in any of three ways. (1) The recurrence may never end, (2) end after a certain
number of occurrences, or (3) end at a specified date. The recurrence interval may be
daily, weekly, or monthly. Each recurrence interval has a specified object that stores the
parameters for its particular setup.
RecurrenceDay
If the recurrence is daily, the Recurrence objects RecurrenceDay object will contain
the needed information to create the recurrence pattern. This object has two properties:
DayInterval and RecurrenceMode. The day interval is the number of days to skip before
creating another occurrence. For example, if you wish to create a recurring appointment
every day then this property would be set to 1. This indicates that each appointment is
one day from the last one. The RecurrenceMode property may be set to one of two
property values. The above example used the DayInterval setting, where you specify
the interval to separate the days. The other property value is Weekdays. This will
create the recurrence every weekday.
Quick Tip
A Recurrence is a grouping of two or
more appointments.
|