コード例 #1
0
ファイル: phonebook.cs プロジェクト: horga83/gfax
        public static ArrayList get_contacts(Phonebook p)
        {
            string buf = null;

            string[] sa;
            //char[] ca = {':',':',':'}; delete me

            ArrayList    records = new ArrayList();
            StreamReader fp      = null;

            // TODO add popup message
            if (p.Type == "gfax")
            {
                fp = open_phonebook(p);
                if (fp == null)
                {
                    Console.WriteLine(Catalog.GetString("Can't open file : {0}"), p.Path);
                    return(records);
                }

                while ((buf = fp.ReadLine()) != null)
                {
                    buf.Trim();

                    if (buf[0] == '#')
                    {
                        continue;
                    }
                    else
                    {
                        sa = buf.Split(':');
                        GfaxContact contact = new GfaxContact();
                        contact.PhoneNumber   = sa[0];
                        contact.ContactPerson = sa[1];
                        contact.Organization  = sa[2];
                        records.Add(contact);
                    }
                }

                fp.Close();
            }

            if (p.Type == "evolution")
            {
                EdsPhoneBooks eds    = new EdsPhoneBooks();
                ArrayList     ebooks = new ArrayList();
                ebooks = eds.GetPhoneBooks();

                IEnumerator enu = ebooks.GetEnumerator();
                while (enu.MoveNext())
                {
                    if ((string)enu.Current == p.Name)
                    {
                        records = eds.GetContacts((string)enu.Current);
                    }
                }
            }

            return(records);
        }
コード例 #2
0
        private void on_BookDruidPageStandard_next(object o, Gnome.NextClickedArgs args)
        {
            // skip next page if active
            if (EvolutionRadioButton.Active)
            {
                NewPhoneBookDruid.Page = druidpagestandard12;

                EdsPhoneBooks eds    = new EdsPhoneBooks();
                ArrayList     ebooks = new ArrayList();
                ebooks = eds.GetPhoneBooks();

                Gtk.TreeIter iter = new Gtk.TreeIter();

                IEnumerator enu = ebooks.GetEnumerator();
                while (enu.MoveNext())
                {
                    iter = store.AppendValues(false, enu.Current);
                    EvolutionTreeView.Model = store;
                }
            }
        }
コード例 #3
0
ファイル: phonebook.cs プロジェクト: horga83/gfax
        public static ArrayList get_contacts(Phonebook p)
        {
            string buf = null;
            string[] sa;
            //char[] ca = {':',':',':'}; delete me

            ArrayList records = new ArrayList();
            StreamReader fp = null;

            // TODO add popup message
            if ( p.Type == "gfax" ) {
                fp = open_phonebook(p);
                if (fp == null) {
                    Console.WriteLine(Catalog.GetString("Can't open file : {0}"), p.Path);
                    return records;
                }

                while ( (buf = fp.ReadLine()) != null ) {
                    buf.Trim();

                    if (buf[0] == '#')
                        continue;
                    else {
                        sa = buf.Split(':');
                        GfaxContact contact = new GfaxContact();
                        contact.PhoneNumber = sa[0];
                        contact.ContactPerson = sa[1];
                        contact.Organization = sa[2];
                        records.Add(contact);
                    }
                }

                fp.Close();
            }

            if ( p.Type == "evolution" ) {
                EdsPhoneBooks eds = new EdsPhoneBooks();
                ArrayList ebooks = new ArrayList();
                ebooks = eds.GetPhoneBooks();

                IEnumerator enu = ebooks.GetEnumerator();
                while ( enu.MoveNext() ) {
                    if ((string)enu.Current == p.Name) {
                        records = eds.GetContacts((string)enu.Current);
                    }
                }
            }

            return records;
        }