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

Gravitybox Schedule.NET
1998-2005 Gravitybox Software LLC
Page 50 of 90
Deleting Appointments
Appointments are just as easy to remove. You may remove by key, index, or object.
The RemoveAt method takes an index [0..N-1] of the object to remove in the collection.
If the index does not exist, an out of range exception is thrown.
Schedule1.AppointmentCollection.RemoveAt(5)
The Remove method is overloaded to take a key or an appointment object. The code
snippet below removes an appointment object and an appointment with the key
“abc123”.
Schedule1.AppointmentCollection.Remove(appointment)
Schedule1.AppointmentCollection.Remove("abc123")
Displaying Dialogs
Now that you can create appointments, you will need to edit them with dialogs. The
schedule comes with a built-in appointment dialog much like MS-Outlook. It provides an
easy to use and stylish editor for an appointment. In the following code snippet an
appointment is edited by passing its reference to the ShowPropertyDialog method of the
Dialogs object. The Dialogs object contains methods for displaying all built-in dialogs.
Schedule1.Dialogs.ShowPropertyDialog(appointment)
If Categories and Providers are present in their respective collections then the default
appointment dialog will allow the user to associate these objects types to an
appointment. However you may display these two dialogs separately without using the
appointment dialog. The following code snippet displays the Categories and Providers
for an existing appointment.
Schedule1.Dialogs.ShowCategoryDialog(appointment)
Schedule1.Dialogs.ShowProviderDialog(appointment)
Canceling / Custom dialogs
Some applications are highly customized. They cannot use the defaults provided by the
schedule. If you wish to write your own dialog screen for editing appointments and other
objects of the schedule, you will need to cancel the defaults so that the user never sees
them. Before the appointment dialog is actually shown, the BeforePropertyDialog event
is raised. In this event you may cancel the edit and display your own custom form. In the
code snippet below, the BeforePropertyDialog event is canceled and a custom form
named CustomForm is displayed.
Private Sub Schedule1_BeforePropertyDialog(ByVal sender As Object, _
     ByVal e As Gravitybox.Objects.EventArgs.BeforePropertyDialogEventArgs) _
     Handles Schedule1.BeforePropertyDialog
  e.Cancel = True
http://www.purepage.com