Exemple #1
0
 void client_FriendListReceived(object sender, FriendListReceivedEventArgs e)
 {
     ThreadStart ts = delegate
     {
         foreach (FriendUser friend in e.Friends)
         {
             this.lbFriends.Items.Add(friend);
         }
     };
     if (InvokeRequired)
         BeginInvoke(ts);
     else
         ts();
 }
        private void HandleFriendsList(ParseData pd)
        {
            DataReader dr = new DataReader(pd.Data);
            int numEntries = dr.ReadByte();
            FriendUser[] list = new FriendUser[numEntries];
            for (int i = 0; i < numEntries; i++)
            {
                FriendUser friend = __ParseNewFriend(dr, i);
                list[i] = friend;
            }

            m_friendsList.AddRange(list);

            Debug.WriteLine("Received friends list; " + list.Length + " user on it.");

            FriendListReceivedEventArgs args = new FriendListReceivedEventArgs(list) { EventData = pd };
            OnFriendListReceived(args);
        }
 void Client_FriendListReceived(object sender, FriendListReceivedEventArgs e)
 {
     if (__friendListReceived != null)
         __friendListReceived.Call(_host.ClientHost, ConvObj(e));
 }