private void WxBatchContacts(WebwxContactInfo cinfo, string uname) { if (!string.IsNullOrWhiteSpace(uname)) { foreach (var c in panUserList.Controls) { ContactItem citem = c as ContactItem; if (citem.Name == uname) { citem.ContactList = cinfo.MemberList; break; } } } else { foreach (var m in cinfo.MemberList) { foreach (var c in panUserList.Controls) { ContactItem citem = c as ContactItem; if (citem.Name == m.UserName) { citem.ContactInfo = m; break; } } } } }
//获取联系人 private void WxContact(WebwxContactInfo info) { foreach (Contact c in info.MemberList) { if (contacts.Find(x => x.UserName == c.UserName) != null) { continue; } Application.DoEvents(); Thread.Sleep(100); ContactAppend(c, true); } }