// copy all contacts that are currently on screen
        // to the addressbook specified in the combobox
        private void copyAll()
        {
            LogManager.Write("copyAll");

            List <Contact> contacts = getCurrentVisibleAddressbook().Contacts;
            string         adb_name = copyAllCombo.Text;

            if (addressbookExists(adb_name))
            {
                LogManager.Write("copyAll_exist");
                Adressbook ad = getAddressbook(adb_name);
                LogManager.Write("copyAll_callback1");
                foreach (Contact contact in contacts)
                {
                    LogManager.Write("copyAll_add");
                    ad.Add(contact);
                }

                // Check if copy contact to another adressbook works
                bool b = false;
                foreach (Contact contact in contacts)
                {
                    b = adressbooks[adressbooks.IndexOf(ad)].contacts.Contains(contact);
                    if (b == false)
                    {
                        break;
                    }
                }
                LogManager.Oracle(": Copy to adressbook", b);
            }

            LogManager.Write("copyAll_callback2");
        }
Esempio n. 2
0
        // fill addressbook with sample contacts
        private void Sample()
        {
            Adressbook a = new Adressbook("sample");

            a.Add(new Contact("Bla", "*****@*****.**"));
            a.Add(new Contact("Pa", "*****@*****.**"));
            a.Add(new Contact("Ma", "*****@*****.**"));
            adressbooks.Add(a);
            a = new Adressbook("sample2");
            a.Add(new Contact("Bas Meesters", "*****@*****.**"));
            a.Add(new Contact("Jarno Le Conte", "*****@*****.**"));
            adressbooks.Add(a);
            a = new Adressbook("sample3");
            a.Add(new Contact("Henk", "*****@*****.**"));
            a.Add(new Contact("Jan", "*****@*****.**"));
            a.Add(new Contact("Piet", "*****@*****.**"));
            a.Add(new Contact("Henkie", "*****@*****.**"));
            a.Add(new Contact("Janneke", "*****@*****.**"));
            a.Add(new Contact("Pieter", "*****@*****.**"));
            a.Add(new Contact("Gerda", "*****@*****.**"));
            a.Add(new Contact("Bettie", "*****@*****.**"));
            a.Add(new Contact("Peter", "*****@*****.**"));
            adressbooks.Add(a);
        }