Exemple #1
0
        private void ShowContactList()
        {
            ChatListItem item = new ChatListItem("联系人");

            foreach (var contact in InitHelper.BatchGetContact.MemberList)
            {
                ChatListSubItem sitem = new ChatListSubItem()
                {
                    NicName     = contact.UserName,
                    DisplayName = contact.NickName,
                    PersonalMsg = contact.Signature
                };
                InitHelper.SetImageAsync(sitem, contact.HeadImgUrl);
                item.SubItems.Add(sitem);
            }
            chatListBox1.BeginInvoke(new Action(() =>
            {
                chatListBox1.Items.Add(item);
            }));
        }
Exemple #2
0
        private void ShowSessionList()
        {
            ChatListItem item = new ChatListItem("会话列表");

            item.IsOpen = true;

            foreach (var contact in InitHelper.WebWeixinInit.ContactList)
            {
                ChatListSubItem sitem = new ChatListSubItem()
                {
                    NicName     = contact.UserName,
                    DisplayName = contact.NickName,
                    PersonalMsg = contact.Signature
                };
                InitHelper.SetImageAsync(sitem, contact.HeadImgUrl);
                item.SubItems.Add(sitem);
            }
            chatListBox1.BeginInvoke(new Action(() =>
            {
                chatListBox1.Items.Add(item);
            }));
        }