![]() ![]() ![]() ![]() Gravitybox Schedule Primer
Page 81
1998-2004 Gravitybox Software LLC
refreshed. This will move the schedule to the desired position before it redraws the
screen.
IsEnabledAreaByValues
The IsEnabledAreaByValues method will take differing
parameters depending on the display options of the
schedule and return to you the availability of a particular
area. To start, you specify the date, room, and time for
which an appointment starts. Also provide as a parameter the length of the area to
check. These four parameters define a definite area. The method checks to determine if
any part of this area is inside of an existing appointment. It returns a Boolean value
indicating this determination. This is an iterative algorithm, so the longer the specified
length, then longer it takes to execute. There may be times that you wish to only check
the time component of availability. If so the last parameter allows you specify a Boolean
value indicating whether you wish to check time only. When this parameter is true all
other criteria are ignored. A good place to use this function is in the BeforeMove,
BeforeCopy, or even the DragOverScheduleItem schedule. You will probably only use
this method in very customized situations since it is built in to the dragging process.
When you move or copy an appointment, the Conflicts collection is checked
automatically and prompts the user if the ConflictWarn property is true. Remember that
the Conflicts collection is only checked and updated automatically if the schedules
ConflictCheck property is true. If you do not care about conflicts, you may turn this
feature off for faster execution.
GetScheduleItemFromCor
This method will return the first appointment that it finds under the specified coordinates.
Given an X and Y coordinate in pixels, this method will check the ScheduleItems
collection to determine the appointment that is scheduled for the date, time, and/or room
to which these coordinates map. Keep in mind that there may be more than one. If there
is a conflict with two appointments scheduled for the exact same date, time, and room,
only the first appointment is returned. The first appointment position is defined by its
order in the ScheduleItems collection. If one appointment was the 17th element in the
collection and the other conflicting appointment was the 57th element, then the 17th
element would be returned.
EnforceTimeLimits
This property ensures that the default dialog will not allow not allow the user to create
an appointment not defined by the time area boundaries. The StartTime and DayLength
properties define the display times of a schedule. When EnforceTimeLimits is set to
true, the user may not set an appointment's StartTime or duration to a value outside of
this defined area. When false, the user may set the time to any value. This all is part of
the default property dialog for an appointment. In code you may of course set the start
time and length of an appointment to any value you wish. This property is provided for
Quick Tip
You may check an areas availability
by using the IsEnabledAreaByValues
method. This will ensure that there
are no conflicts for an area.
|