Datasheet

Method Return Type Description
DeleteEvent() None Deletes from the database the
event with
EventId equal to
mEventId of the object. The
DiaryEvent object’s values are
re-initialized to their defaults.
DeleteEvent(ByVal EventId As Long) None Shared method that deletes the
event from the database with
an
EventId value equal to the
EventId argument of the
method.
In addition to the constructors and public methods, the
DiaryEvent class has these four properties:
Property Type Description
EventDescription String Description of the event.
EventName String Short name for the event.
EventDate Date Date the event starts.
EventDuration Integer Length of time in minutes that the event lasts.
One more class to go. The next section looks at the diary collection handling class:
DiaryEventCollection.
The DiaryEventCollection Class
The DiaryEventCollection class inherits from the System.Collections.CollectionBase class. Its
purpose is simply to store a collection of
DiaryEvent objects. The class employs the following methods:
Method Return Type Description
Add(ByVal NewDiaryEvent As None Adds a DiaryEvent object to the collection
DiaryEvent) held by the DiaryEventCollection
object.
Add(ByVal DiaryEventId None Creates a new DiaryEvent object.
As Long) DiaryEventId is passed to the
DiaryEvent object’s constructor to ensure
it’s populated with the event’s details from
the database. The new
DiaryEvent object
is then added to the collection maintained
by the DiaryEventCollection object.
Remove(ByVal Index As None Removes the DiaryEvent object from the
Integer) collection at the specified index.
16
Chapter 1
04_749516 ch01.qxp 2/10/06 9:11 PM Page 16