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); }
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; } } }
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; }