/// <summary> /// Reset result list and fill with new values /// </summary> private void UpdateGUi() { listBoxConReg.Items.Clear(); _NumofRegCon.Text = m_contactMngr.Count.ToString(); for (int index = 0; index < m_contactMngr.Count; index++) { listBoxConReg.Items.Add(m_contactMngr.GetContact(index).ToString()); } }
/// <summary> /// Method used to fetch information regarding the selected contact and populate all boxes with information regarding it. /// </summary> private void UpdateContactInfoFromRegistry() { int index = listBoxMain.SelectedIndex; if (index < 0) { return; } Contact contact = contactmanager.GetContact(index); cBoxCountry.SelectedIndex = (int)contact.Address.Country; txtBoxFirstName.Text = contact.FirstName; txtBoxLastName.Text = contact.LastName; txtBoxCity.Text = contact.Address.City; txtBoxStreet.Text = contact.Address.Street; txtBoxZipCode.Text = contact.Address.ZipCode; }