Navigation bar
  Print document Start Previous page
 40 of 65 
Next page End  

Gravitybox WebSchedule.NET
1998-2005 Gravitybox Software LLC
Page 38 of 65
The NoDropCollection and ColoredAreaCollection are created from the
ScheduleAreaCollection class. These two class instances define the no-drop areas and
other colored areas of a schedule. There is also a matching ScheduleAreaList class. 
The ColoredAreaCollection object allows you to define colored areas of a schedule.
There is no behavior associated with this collection. The areas are just colored to
convey information to the user while still allowing all appointment actions like add, edit,
and delete. 
The NoDropAreaCollection object holds schedule areas that are defined to disallow
appointment drops. This is useful to define holidays, lunch hours, etc where
appointments should not exist. However you may still programmatically add
appointments to these areas. So as not to confuse your users you may wish to check to
determine if a proposed appointment is in a no-drop area. You cannot query the
collection directly but use its list. In the following code snippet, the
NoDropAreaCollection is converted to ScheduleAreaList and then queried to determine
if a new proposed appointment will be inside of it.
Dim list As Gravitybox.Objects.ScheduleAreaList
list = Schedule1.NoDropAreaCollection.ToList
Dim b As Boolean = list.IsOverlap(#1/2/2004#, #8:00:00 AM#, 60)
The code above queries the ScheduleAreaList to determine if a 1-hour hour slot on
January 2, 2004 at 8am overlaps any area in the list. If any appointment overlaps any
portion of the defined area the method returns true, otherwise false.
Recurrences
Another advanced concept is that of recurrences. A recurrence is set of appointments
that recur at some specified interval for some specific period. An example of this would
be an appointment that occurs every Monday at 8:00AM until June 27, 2005.
The default property dialog has a recurrence sub-dialog that can be displayed from the
property screen. You can also access recurrences from code. Keep in mind that in the
background the schedule actually creates zero or more appointments for each
recurrence pattern. Appointments are said to be in a recurrence pattern if they have the
same RecurrenceId. When an appointment is created it is given a unique RecurrenceId.
So in essence, every appointment is part of a recurrence pattern even if is in a group of
one. You can set the RecurrenceId property to any string you wish. This makes it easy
to put two appointments in a recurrence pattern, just set their RecurrenceId property to
the same value. When you store appointment information to your database you will
want to create a field for this value or the next time you load your appointments they will
have unique RecurrenceId values and you will have no recurring appointments.
There are three types of recurrences that can be created: daily, weekly, and monthly.
For example, you may wish to create an appointment for every Monday at 8:00AM until
June 27, 2005 or every Monday at 8:00AM for three weeks. Notice that I added some
http://www.purepage.com