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

Gravitybox Schedule.NET
1998-2005 Gravitybox Software LLC
Page 74 of 90
objects. The example adds 3 categories to the appointment’s CategoryList object and 3
providers to the appointment’s ProviderList object.
Dim ii As Integer
For ii = 1 To 10
  Call Schedule1.CategoryCollection.Add("", "Category" & ii.ToString())
  Call Schedule1.ProviderCollection.Add("", "Provider" & ii.ToString())
Next
Dim appointment As Appointment = Schedule1.AppointmentCollection.Add("",
#1/1/2004#, #10:00:00 AM#, 60)
Call appointment.CategoryList.Add(Schedule1.CategoryCollection(2))
Call appointment.CategoryList.Add(Schedule1.CategoryCollection(5))
Call appointment.CategoryList.Add(Schedule1.CategoryCollection(7))
Call appointment.ProviderList.Add(Schedule1.ProviderCollection(1))
Call appointment.ProviderList.Add(Schedule1.ProviderCollection(6))
Call appointment.ProviderList.Add(Schedule1.ProviderCollection(9))
How do I import/export an appointment to/from a VCAL file?
The VCAL file format is an international standard that is used to exchange calendar
information. The GbSchedule.NET component supports importing and exporting this file
format. The code snippet below exports the entire AppointmentCollection to this file
format. The method “ToVCAL” is overloaded and may save any number of
appointments to this file format. When importing a file, all appointments in the file are
added to the AppointmentCollection object.
Call Schedule1.AppointmentCollection.ToVCAL("c:\test.vcal")
Call Schedule1.AppointmentCollection.FromVCAL("c:\test.vcal")
How do I get an appointment from coordinates?
The method “GetAppointmentFromCor” on the ScheduleVisibilty object will return an
appointment under a pair of coordinates, if one exists. The code snippet below
demonstrates this.
Dim appointment As Appointment =
Schedule1.Visibility.GetAppointmentFromCor(150, 200)
How do I save/load an appointment to/from an XML stream?
One or more appointments may be saved to an XML stream. This is done using the
“ToXML” function of an appointment object.
Dim s As String = Schedule1.AppointmentCollection.ToXML()
Also the AppointmentCollection object allows you save the entire collection is an XML
file using the “SaveXML” method.
Call Schedule1.AppointmentCollection.SaveXML("c:\test.xml")