Beispiel #1
0
 public void InitializeFriends(string myNickName)
 {
     _client     = ServiceProvider.Clent;
     OnlineCount = 0;
     Friends.Clear();
     TEmployeeDTO[] result = _client.TEmployeeQueryAll();
     Array.ForEach(result, t => {
         FriendData data = new FriendData();
         data.Image      = t.EntryImage;
         data.Name       = t.EmployeeName;
         data.Data       = t;
         TLoginDTO login = _client.TLoginQueryById(t.EmployeeId);
         data.State      = CommomHelper.ParseState(login.State);
         data.Order      = login.State;
         if (t.EmployeeName == myNickName)
         {
             data.Order = 1;
             data.State = FriendState.Online;
         }
         data.Emotion       = t.Emotion;
         FriendInfo info    = new FriendInfo(data);
         info.Width         = this.Width;
         info.Click        += info_Click;
         info.ChangedState += info_ChangedState;
         info.DoubleClick  += info_DoubleClick;
         Friends.Add(t.EmployeeName, info);
     });
     OrderList();
 }