/// <summary> /// 好友列表点击 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void pbFriends_Click(object sender, EventArgs e) { try { ((Action)(delegate() { this.pbFriends.BackgroundImage = Resources.haoyou2; pbMessage.BackgroundImage = Resources.message1_2_; List <object> data = MessageSync.FriendsList(); this.BeginInvoke((Action) delegate() { wFriendsList.Items.Clear(); wFriendsList.Width = 215; wFriendsList.Height = 446; wFriendsList.Items.AddRange(data.ToArray()); //好友列表 this.panelList.Controls.Clear(); this.panelList.Controls.Add(wFriendsList); wFriendsList.Show(); }); })).BeginInvoke(null, null); } catch (Exception) { throw; } }
/// <summary> /// 好友列表 /// </summary> public List <object> FriendLists() { try { //加载好友列表数据 return(MessageSync.FriendsList()); } catch (Exception ex) { return(null); } }