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

Gravitybox Schedule.NET
1998-2005 Gravitybox Software LLC
Page 11 of 90
Chapter 1
Collections, Lists and Objects
This heart of the schedule is its collections. They hold all of the information necessary to
display a schedule. All of the rooms, categories, providers, icons, and appointments are
held in collections. Collections are nothing more than a group of similar objects. All
collections in the GbSchedule.NET software are derived from the class
“System.Collections.CollectionBase”. They provide a common interface with certain
properties and methods. For example all collections have methods: Add, Contains,
IndexOf, Remove and RemoveAt.
Lists differ from collections in that lists holds references to previously created objects
and collection actually create objects. Most objects present in the GbSchedule.NET
object modal are not directly creatable. The collections serve as object factories as well
as repositories. You may add an existing object to a list but may not create a new object
with the list. For example, to create a Category you would use the CategoryCollection
object located on the schedule. Each Appointment object has a CategoryList. This list is
not used to create new Category objects but is used to store references to categories
that exist in the schedule’s CategoryCollection. In this way you may associate existing
categories with an appointment. If a category is removed from the schedule’s
CategoryCollection, the Category object is also removed from all lists in which it resides
since the object does not exist after its removal. The same rules hold for all lists. Once
an object is removed from its parent collection, it is also removed from all lists that
contain it.
Collections
Overview
Collections in the schedule component are the repositories of data. These form the
backbone of the schedule since their only purpose is to create and hold data. The
schedule is not bound to any external data source and only displays the data in its
collections.
AppointmentCollection
All appointments for a schedule are held in the AppointmentCollection. The collection
itself is used to create appointments as appointments may not be created directly with
the “new” keyword. You must use the “Add” method of the collection to specify a
number of parameters and it will create, add, and return the new object.
RoomCollection
The RoomCollection defines the rooms that are available on the schedule. Rooms may
be used in the display a schedule’s axis. These objects are used when the user needs
to view room specific information on one of the axes. Room objects are not directly
http://www.purepage.com