Initialization
The PhoneFormObj_Load is the event-handler for the PhoneFormObj Load event. The method does the following:
-
Invokes InitConnection. This method, which you have already coded, creates and opens the connection to Caché.
-
Invokes InitContactList. This method, which was explained on an earlier page, creates a list, named ContactList, containing the object IDs of all the Contact instances in the database.
-
Initializes the comboboxes for the Edit Phone Information and Edit Contact Information sections of the form.
-
Invokes DisplayTreeView. This method, which will be explained on a later page, creates the tree displayed on the left hand side of the form.
Here is the method. Add the body of the method to the PhoneFormObj_Load stub in PhoneFormObj.cs.
private void PhoneFormObj_Load(object sender, EventArgs e)
{
InitConnection();
InitContactList();
comboBox1.Items.AddRange(new Object[] { "Business", "Personal" });
comboBox2.Items.AddRange(new Object[]
{ "Business", "Home", "Mobile", "Fax" });
DisplayTreeView();
}