Esempio n. 1
0
 private void CooperationStaffNewMessage(IDKin.IM.Core.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);
             ((INWindow)this.dataService.INWindow).ContentTab.SelectedItem = item;
         }
     }
     CoopStaffChatTabControl tab = item.TabContent;
     if (tab != null)
     {
         tab.ChatComponent.AddCooperationMessageStaff(message, false);
         tab.ChatComponent.inputMsgBox.Focus();
     }
 }
 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)
     {
     }
 }
Esempio n. 3
0
 private void CooperationCommonEvent(CooperationCommonResponse response)
 {
     if (response != null)
     {
         CoopStaffTab item = this.dataService.GetCooperationStaffChatTab((long)((ulong)Jid.GetUid(response.from_jid)), response.projectID) as CoopStaffTab;
         if (item == null)
         {
             CooperationStaff staff = this.dataService.GetCooperationStaff((long)((ulong)Jid.GetUid(response.from_jid)), response.projectID);
             CooperationProjectWrapper cooperationProjectWrapper = this.dataService.GetCooperationProjectWrapper(response.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);
             }
         }
         if (item != null)
         {
             this.ActiveInWindow();
             this.PickUpMessageProcessor();
             MessageBoxWindow mbw = this.dataModel.GetMessageBox();
             if (mbw != null)
             {
                 mbw.Refresh();
             }
             this.FlashIconPorcessor();
             CooperationStaff staff = this.dataService.GetCooperationStaff((long)((ulong)Jid.GetUid(response.from_jid)), response.projectID);
             if (staff != null)
             {
                 item.TabContent.ChatComponent.AddMessageNotice(staff.Name + "给你发送了一个震动!");
                 this.SelectedTab(item);
                 item.TabContent.ChatComponent.Vibration(true);
             }
         }
     }
 }