private void CooperationStaffNewMessage(Message message)
        {
            CoopStaffTab item = this.dataService.GetCooperationStaffChatTab((long)((ulong)Jid.GetUid(message.FromJid)), message.ProjectId) as CoopStaffTab;

            if (item == null)
            {
                CooperationStaff          staff = this.dataService.GetCooperationStaff((long)((ulong)Jid.GetUid(message.FromJid)), message.ProjectId);
                CooperationProjectWrapper cooperationProjectWrapper = this.dataService.GetCooperationProjectWrapper(message.ProjectId);
                if (staff != null && cooperationProjectWrapper != null)
                {
                    item = new CoopStaffTab(staff, cooperationProjectWrapper);
                    item.SetDefaultStyle();
                    ((INWindow)this.dataService.INWindow).ContentTab.Items.Add(item);
                    this.dataService.AddCooperationStaffChatTab(staff.Uid, staff.UnitedProjectid, item);
                }
            }
            this.baseTab = item;
            CoopStaffChatTabControl tab = item.TabContent;

            if (tab != null)
            {
                tab.ChatComponent.AddCooperationMessageStaff(message, false);
                tab.ChatComponent.inputMsgBox.Focus();
            }
        }
Exemplo n.º 2
0
 private void UserControl_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     try
     {
         if (e.LeftButton == MouseButtonState.Pressed && this.staff.Uid != this.sessionService.Uid)
         {
             CoopStaffTab item = this.dataService.GetCooperationStaffChatTab(this.staff.Uid, this.staff.UnitedProjectid) as CoopStaffTab;
             if (item != null)
             {
                 ((INWindow)this.dataService.INWindow).ContentTab.SelectedItem = item;
             }
             else
             {
                 item = new CoopStaffTab(this.staff, this.cooperationProjectWrapper);
                 item.SetDefaultStyle();
                 ((INWindow)this.dataService.INWindow).ContentTab.Items.Add(item);
                 this.dataService.AddCooperationStaffChatTab(this.staff.Uid, this.staff.UnitedProjectid, item);
                 ((INWindow)this.dataService.INWindow).ContentTab.SelectedItem = item;
                 this.MessageProcessor(item);
             }
         }
     }
     catch (System.Exception)
     {
     }
 }