public static Dictionary <string, Model.Contact> RetreiveAllContact() { Dictionary <string, Model.Contact> contacts = new Dictionary <string, Model.Contact>(); NKTWABLib.NKTWAB NKT = new NKTWABLib.NKTWAB(); NKTWABLib.Folder rootFolder = NKT.RootFolder; NKTWABLib.ContactContainer contCont = (NKTWABLib.ContactContainer)NKT.get_Item(rootFolder.Folders.get_Item(1).EntryID); //ComctlLib.Node tvItem = new ComctlLib.Node(); for (int i = 1; i <= contCont.Contacts.Count; i++) { Model.Contact contact = new Model.Contact(); NKTWABLib.Contact item = contCont.Contacts.get_Item(i); contact.FullName = item.Name; contact.Address = item.HomeAddressCity; contact.HomePhone = item.HomeTelephoneNumber; contact.MobilePhone = item.MobileTelephoneNumber; contact.Email = item.Email1Address; contact.BusinessPhone = item.BusinessTelephoneNumber; contact.BusinessFax = item.BusinessFaxNumber; contact.IPPhone = ""; if (!contacts.ContainsKey(contact.FullName)) { contacts.Add(contact.FullName, contact); } } return(contacts); }
private void button1_Click(object sender, EventArgs e) { //DirectoryInfo di = new DirectoryInfo("C:/abc/def"); //di.Create(); NKTWABLib.NKTWAB NKT = new NKTWABLib.NKTWAB(); NKTWABLib.Folder rootFolder = NKT.RootFolder; listBox1.Items.Add(rootFolder.Folders.Count); ////NKTWABLib.Contacts item = new NKTWABLib.Contacts(); ////ComctlLib.ListItem lvItem = new ComctlLib.ListItem(); //NKTWABLib.ContactContainer contCont = (NKTWABLib.ContactContainer)NKT.get_Item(rootFolder.Folders.get_Item(1).EntryID); ////ComctlLib.Node tvItem = new ComctlLib.Node(); //for (int i = 1; i <= contCont.Contacts.Count;i++ ) //{ // NKTWABLib.Contact item = contCont.Contacts.get_Item(i); // listBox1.Items.Add(item.Name); //} //MessageBox.Show("" + contCont.Contacts.Count); // System.Diagnostics.Process.Start("mailto:email@add ress?subject=mysubject"); }