Navigation bar
  Print document Start Previous page
 80 of 90 
Next page End  

Gravitybox Schedule.NET
1998-2005 Gravitybox Software LLC
Page 78 of 90
If Schedule1.AppointmentCollection.IsConflict(appointment) Then
  'Do Something...
End If
If you wish to only check conflicts between two appointments and not the whole
collection, you may use the IsConflict method of an appointment object.
Dim appointment1 As Appointment
Dim appointment2 As Appointment
'Add some appointments...
If appointment1.IsConflict(appointment2) Then
  'Do Something...
End If
How do I attach additional, custom information to an object (appointment,
category, etc.)?
Most objects in the GbSchedule.NET framework have a child object: PropertyCollection.
This is a collection of name/value pairs. You may store any number of values with a
key, name, and value. These are all string values. You may reference the collection by
key, name, or index [0..N-1]. This collection is very useful if you have custom
information that you need to associate with an object.
Dim appointment As Appointment
'Add some appointments...
appointment.PropertyCollection.Add("", "MyProperty", "MyValue")
How do I ensure that an appointment’s length will be in a specified range?
When the user is resizing an appointment, he can set its length to any value. If you
need an appointment appointment’s length to be in a specified range this can be a
problem. Each appointment has a MinLength and MaxLength property that is used to
enforce its length. When either value is (-1) that value, either min or max, is not
enforced. The code snippet below ensures that the appointment’s length will always be
between 1 and 2 hours.
Dim appointment As Appointment
‘Add some an appointment…
appointment.MinLength = 60
appointment.MaxLength = 120
How do I ensure that a specified area never receives appointments?
The NoDropAreaCollection allows you to add areas of the schedule where
appointments are invalid. These defined areas will be a specified color and appointment
moves or copies are not allowed. The code snippet below adds Jan 1, 2004 to the
NoDropAreaCollection. You may also define combinations of dates, times, room,
providers, etc.