private void MessageProcessor(EntStaffTab item)
 {
     if (item != null)
     {
         System.Collections.Generic.List <Message> list = DataModel.Instance.GetMessage(this.staff.Uid, MessageActorType.EntStaff);
         if (list != null && list.Count > 0)
         {
             foreach (Message message in list)
             {
                 item.TabContent.ChatComponent.AddMessageStaff(message, false);
                 item.TabContent.ChatComponent.inputMsgBox.Focus();
             }
         }
         DataModel.Instance.RemoveMessage(this.staff.Uid, MessageActorType.EntStaff);
         MessageBoxWindow mbw = DataModel.Instance.GetMessageBox();
         if (mbw != null)
         {
             mbw.Refresh();
         }
     }
 }
예제 #2
0
 private void WatchMessage(GroupChatTabControl chatTab)
 {
     System.Collections.Generic.List <Message> list = DataModel.Instance.GetMessage(this.group.Gid, MessageActorType.EntGroup);
     if (list != null)
     {
         foreach (Message message in list)
         {
             if (message != null)
             {
                 chatTab.ChatComponent.AddMessageGroup(message, false);
             }
         }
         DataModel.Instance.RemoveMessage(this.group.Gid, MessageActorType.EntGroup);
         MessageBoxWindow mbw = DataModel.Instance.GetMessageBox();
         if (mbw != null)
         {
             mbw.Refresh();
         }
         this.FlashIconPorcessor();
     }
 }
 public void PickUpMessage()
 {
     try
     {
         if (!this.PickUpMessageProcessor())
         {
             if (this.messageType == MessageActorType.EntStaff)
             {
                 Staff staff = this.dataService.GetStaff(this.id);
                 if (staff != null)
                 {
                     System.Collections.Generic.List <Message> list = this.dataModel.GetMessage(this.id, MessageActorType.EntStaff);
                     this.ShowStaffNewMessage(this.id, list);
                 }
             }
             if (this.messageType == MessageActorType.EntGroup)
             {
                 EntGroup group = this.dataService.GetEntGroup(this.id);
                 if (group != null)
                 {
                     System.Collections.Generic.List <Message> list = this.dataModel.GetMessage(this.id, MessageActorType.EntGroup);
                     this.ShowGroupNewMessage(this.id, list);
                 }
             }
             if (this.messageType == MessageActorType.Roster)
             {
                 Roster roster = this.dataService.GetRoster(this.id);
                 if (roster != null)
                 {
                     System.Collections.Generic.List <Message> list = this.dataModel.GetMessage(this.id, MessageActorType.Roster);
                     this.ShowRosterNewMessage(this.id, list);
                 }
             }
             if (this.messageType == MessageActorType.AddRoster)
             {
                 System.Collections.Generic.List <Message> list = this.dataModel.GetMessage(this.id, MessageActorType.AddRoster);
                 if (list != null && list.Count > 0)
                 {
                     this.ShowAddRosterNewMessage(this.id, list);
                 }
             }
             if (this.messageType == MessageActorType.AddRosterAsk)
             {
                 System.Collections.Generic.List <Message> list = this.dataModel.GetMessage(this.id, MessageActorType.AddRosterAsk);
                 if (list != null && list.Count > 0)
                 {
                     this.ShowAddRosterAskNewMessage(this.id, list);
                 }
             }
             if (this.messageType == MessageActorType.CooperationStaff)
             {
                 System.Collections.Generic.List <Message> list = this.dataModel.GetCooperationStaffMessage(this.id, this.projectid, MessageActorType.CooperationStaff);
                 if (list != null && list.Count > 0)
                 {
                     this.ShowCooperationStaffNewMessage(this.id, this.projectid, list);
                 }
             }
         }
         this.FlashIconPorcessor();
         MessageBoxWindow mbw = this.dataModel.GetMessageBox();
         if (mbw != null)
         {
             mbw.Refresh();
         }
         this.ActiveInWindow();
     }
     catch (System.Exception ex)
     {
         this.logger.Error(ex.ToString());
     }
 }