public void Refresh()
 {
     try
     {
         this.lbMessageBox.Items.Clear();
         if (!this.dataModel.HasMessage())
         {
             NotifyIconUtil.Instance.SetFlashIcon(FlashIconType.Default);
             base.Close();
         }
         foreach (string key in this.dataModel.MessageBoxSort)
         {
             if (!string.IsNullOrEmpty(key))
             {
                 System.Collections.Generic.List<Message> list = this.dataModel.GetMessage(key);
                 if (list != null && list.Count > 0)
                 {
                     Message message = list[0];
                     if (message != null)
                     {
                         if (message.MessageObjectType == MessageActorType.EntStaff)
                         {
                             Staff staff = this.dataService.GetStaff((long)((ulong)Jid.GetUid(message.FromJid)));
                             if (staff != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.EntStaff, staff.Uid, staff.Name, list.Count.ToString(), staff.HeaderImage);
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                         if (message.MessageObjectType == MessageActorType.EntGroup)
                         {
                             EntGroup group = this.dataService.GetEntGroup(message.Gid);
                             if (group != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.EntGroup, group.Gid, group.Name, list.Count.ToString(), this.imageService.GetIcon(ImageTypeIcon.Group));
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                         if (message.MessageObjectType == MessageActorType.Roster)
                         {
                             Roster roster = this.dataService.GetRoster((long)((ulong)Jid.GetUid(message.FromJid)));
                             if (roster != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.Roster, roster.Uid, roster.Name, list.Count.ToString(), roster.HeaderImage);
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                         if (message.MessageObjectType == MessageActorType.AddRoster)
                         {
                             RosterAddRequest request = message.MessageObject as RosterAddRequest;
                             if (request != null && request.user != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.AddRoster, request.uid, "验证消息", list.Count.ToString(), null);
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                         if (message.MessageObjectType == MessageActorType.AddRosterAsk)
                         {
                             RosterAddResponse response = message.MessageObject as RosterAddResponse;
                             if (response != null && response.user != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.AddRosterAsk, response.uid, "验证消息", list.Count.ToString(), null);
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                         if (message.MessageObjectType == MessageActorType.CooperationStaff)
                         {
                             CooperationStaff staff2 = this.dataService.GetCooperationStaff((long)((ulong)Jid.GetUid(message.FromJid)), message.ProjectId);
                             if (staff2 != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.CooperationStaff, staff2.Uid, staff2.UnitedProjectid, staff2.Name, list.Count.ToString(), staff2.HeaderImage);
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                     }
                 }
             }
         }
         base.Top = SystemParameters.WorkArea.Height - 47.0 - (double)(this.lbMessageBox.Items.Count * 30);
     }
     catch (System.Exception e)
     {
         this.logger.Error(e.ToString());
     }
 }
 private void PickUpAllHandler(object sender, MouseButtonEventArgs e)
 {
     try
     {
         MessageBoxItem[] stackPanels = new MessageBoxItem[this.lbMessageBox.Items.Count];
         this.lbMessageBox.Items.CopyTo(stackPanels, 0);
         MessageBoxItem[] array = stackPanels;
         for (int i = 0; i < array.Length; i++)
         {
             MessageBoxItem mbi = array[i];
             mbi.PickUpMessage();
         }
         array = stackPanels;
         for (int i = 0; i < array.Length; i++)
         {
             MessageBoxItem mbi = array[i];
             BaseTab baseTab = this.FindChatTab(mbi.MessageType, mbi.Id, mbi.Projectid);
             if (baseTab != null)
             {
                 baseTab.SetFlashingStyle();
             }
         }
         INWindow inWindow = this.dataService.INWindow as INWindow;
         BaseTab selectedTab = inWindow.ContentTab.SelectedItem as BaseTab;
         if (selectedTab != null)
         {
             selectedTab.SetDefaultStyle();
         }
         this.ActiveInWindow();
     }
     catch (System.Exception ex)
     {
         this.logger.Error(ex.ToString());
     }
 }