![]() Gravitybox Schedule.NET
1998-2005 Gravitybox Software LLC
Page 77 of 90
Dim theDate As Date = Schedule1.Visibility.FirstVisibleDate()
Dim theTime As Date = Schedule1.Visibility.FirstVisibleTime()
How do I check for space availability?
The AppointmentList method IsAreaAvailable allows you to check if any appointment
overlaps an area. If no appointment in the specified list overlaps the defined space then
the method return true. If one or more appointments cover any part of the defined area
then false is returned. The code below creates a list from the entire
AppointmentCollection effectively verify if a schedule area is available for the whole
schedule.
If Schedule1.AppointmentCollection.ToList.IsAreaAvailable(#1/1/2004#, _
#10:00:00 AM#, 60) Then
'Do Something...
End If
How do I determine if a time slot is enabled?
Before you add an appointment in code, you may wish to determine if the time slot is
inside of a NoDropArea. The schedules NoDropAreaCollection object may be used to
determine if a slot if enabled or not. The code snippet converts the
NoDropAreaCollection to a ScheduleAreaList and then checks it to determine if Jan 1,
2004, 10:00AM for 1 hour is enabled or not.
If Schedule1.NoDropAreaCollection.ToList.IsOverlap(#1/1/2004#, _
#10:00:00 AM#, 60) Then
'Do Something...
End If
How do I get a list of conflicts for an appointment?
The schedules AppointmentCollection can be converted to an AppointmentList and
searched for a list of conflicts. Given a specific appointment, the lists GetConflicts
method returns another AppointmentList of appointments that conflict with it. If there are
no conflicts, the returned list has no objects in it.
Dim al As AppointmentList
al = Schedule1.AppointmentCollection.ToList.GetConflicts(appointment)
How do I determine if two appointments conflict?
The AppointmentCollection object can be used to determine if a specific appointment
conflicts with any other appointment in the collection. The code snippet below
demonstrates this.
Dim appointment As Appointment
'Add some appointments...
|