Ejemplo n.º 1
0
        private void on_PhonebookComboBox_changed(object o, EventArgs args)
        {
            ArrayList contacts = null;
            Phonebook p;

            // get the first book in the list and load the liststore
            if (myPhoneBooks.Length > 0)
            {
                string[] list = new string[myPhoneBooks.Length];

                if (myPhoneBooks != null)
                {
                    // populate the list
                    int i = 0;
                    foreach (Phonebook pb in myPhoneBooks)
                    {
                        list[i++] = pb.Name;
                    }
                }

                p = Phonetools.get_book_from_name(list[PhonebookComboBox.Active]);
                if (p == null)
                {
                    return;
                }

                // Clear the list_store
                ItemStore.Clear();

                contacts = Phonetools.get_contacts(p);

                if (contacts != null)
                {
                    IEnumerator enu = contacts.GetEnumerator();
                    while (enu.MoveNext())
                    {
                        GfaxContact c = new GfaxContact();
                        c = (GfaxContact)enu.Current;
                        ItemView.AddTextToRow(c.Organization, c.PhoneNumber, c.ContactPerson);
                    }
                    if (p.Type == "evolution")
                    {
                        pbIsReadOnly = true;
                        EditPhbCompanyEntry.Sensitive = false;
                        EditPhbNumberEntry.Sensitive  = false;
                        EditPhbNameEntry.Sensitive    = false;
                    }
                    else
                    {
                        pbIsReadOnly = false;
                        EditPhbCompanyEntry.Sensitive = true;
                        EditPhbNumberEntry.Sensitive  = true;
                        EditPhbNameEntry.Sensitive    = true;
                        eventsEnabled = true;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void on_ok_button_clicked(object o, EventArgs args)
        {
            ArrayList lsdest   = new ArrayList();
            ArrayList bsdest   = new ArrayList();
            ArrayList contacts = new ArrayList();

            lsdest = ls.GetSelections(ALL_COLUMNS);

            // if there are indiviual entries don't do entire phonebooks
            if (lsdest.Count > 0)
            {
                IEnumerator enu = lsdest.GetEnumerator();
                while (enu.MoveNext())
                {
                    GfaxContact c = new GfaxContact();
                    c.Organization = (string)enu.Current;
                    enu.MoveNext();
                    c.PhoneNumber = (string)enu.Current;
                    enu.MoveNext();
                    c.ContactPerson = (string)enu.Current;
                    gfax.Destinations.Add(c);
                }
            }
            else
            {
                bsdest = bs.GetSelections(COLUMN_0);
                if (bsdest.Count > 0)
                {
                    IEnumerator enu = bsdest.GetEnumerator();
                    while (enu.MoveNext())
                    {
                        foreach (Phonebook p in myPhoneBooks)
                        {
                            if (p.Name == (string)enu.Current)
                            {
                                contacts = Phonetools.get_contacts(p);
                            }
                        }

                        // add contacts to global desinations
                        if (contacts.Count > 0)
                        {
                            IEnumerator enuc = contacts.GetEnumerator();
                            while (enuc.MoveNext())
                            {
                                gfax.Destinations.Add((GfaxContact)enuc.Current);
                            }
                        }
                    }
                }
            }

            phbd.Destroy();
        }
Ejemplo n.º 3
0
        // loads the phone book into list_store
        private void load_phone_book(Phonebook p)
        {
            ArrayList contacts = null;

            // Clear the list_store
            list_store.Clear();

            contacts = Phonetools.get_contacts(p);
            if (contacts == null)
            {
                return;
            }

            IEnumerator enu = contacts.GetEnumerator();

            while (enu.MoveNext())
            {
                GfaxContact c = new GfaxContact();
                c = (GfaxContact)enu.Current;
                ls.AddTextToRow(c.Organization, c.PhoneNumber, c.ContactPerson);
            }
        }