![]() Gravitybox WebSchedule.NET
1998-2005 Gravitybox Software LLC
Page 58 of 65
'All appointment in either list
listUnion = list1.Union(list2)
'Only object that are in both lists
listIntersection = list1.Intersect(list2)
'All object in list 1 minus all object in list2
listDifference = list1.Subtract(list2)
How do I ensure a day (time, room, etc.) is visible in the viewport?
The schedule has a visibility object that can bring any portion of the schedule into the
viewport. The Show
method take a parameter that identifies an area to display. If
possible the area is brought into the viewing area. The code snippet below ensures that
a date and a time are visible.
Call Schedule1.Visibility.ShowDate(#1/1/2004#)
Call Schedule1.Visibility.ShowTime(#11:00:00 AM#)
How do I get the first visible date (time, room, etc) in the viewport?
The schedules visibility object also can be used to determine what is the first date, time,
etc that is visible in the top, left corner of the schedule. The code snippet below
retrieves the first visible date and time for the schedule.
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.
|