Beispiel #1
0
 //Loading settings
 private void Form1_Load(object sender, EventArgs e)
 {
     Object restorePersonal = Serialise.Recup(personalSave);
     Object restoreProfessional = Serialise.Recup(professionalSave);
     if (restorePersonal != null)
     {
         personalContacts = (List<Contact>)restorePersonal;
     }
     if (restoreProfessional != null)
     {
         professionalContacts = (List<Contact>)restoreProfessional;
     }
     UpdateListbox();
 }
Beispiel #2
0
        //Refreshes contacts listbox and saves the new one
        private void UpdateListbox()
        {
            personalContacts.Sort();
            professionalContacts.Sort();
            lstContacts.Items.Clear();
            allContacts.Clear();
            foreach (Contact contact in personalContacts)
            {
                allContacts.Add(contact);
                lstContacts.Items.Add(contact.StringName());
            }
            Serialise.Save(personalSave, personalContacts);
            foreach (Contact contact in professionalContacts)
            {
                allContacts.Add(contact);
                lstContacts.Items.Add(contact.StringName());
            }
            Serialise.Save(professionalSave, professionalContacts);

        }