private void UserControl_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (this.staff.Uid != this.sessionService.Uid) { try { if (e.LeftButton == MouseButtonState.Pressed && this.staff.Uid != this.sessionService.Uid) { EntStaffTab item = this.dataService.GetStaffChatTab(this.staff.Uid) as EntStaffTab; if (item != null) { ((INWindow)this.dataService.INWindow).ContentTab.SelectedItem = item; } else { item = new EntStaffTab(this.staff); item.SetDefaultStyle(); ((INWindow)this.dataService.INWindow).ContentTab.Items.Add(item); this.dataService.AddStaffChatTab(this.staff.Uid, item); ((INWindow)this.dataService.INWindow).ContentTab.SelectedItem = item; } } } catch (System.Exception) { } } }
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(); } } }
private void StaffNewMessage(IDKin.IM.Core.Message message) { EntStaffTab item = this.dataService.GetStaffChatTab((long)((ulong)Jid.GetUid(message.FromJid))) as EntStaffTab; if (item == null) { Staff staff = this.dataService.GetStaff((long)((ulong)Jid.GetUid(message.FromJid))); if (staff != null) { item = new EntStaffTab(staff); item.SetDefaultStyle(); ((INWindow)this.dataService.INWindow).ContentTab.Items.Add(item); this.dataService.AddStaffChatTab(staff.Uid, item); ((INWindow)this.dataService.INWindow).ContentTab.SelectedItem = item; } } PersonalChatTabControl tab = item.TabContent; if (tab != null) { tab.ChatComponent.AddMessageStaff(message, false); tab.ChatComponent.inputMsgBox.Focus(); } }
private void UserControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed && this.staff.Uid != this.sessionService.Uid) { INWindow window = this.dataService.INWindow as INWindow; if (window != null) { window.tbxSearch.Text = this.staff.Name; } EntStaffTab item = this.dataService.GetStaffChatTab(this.staff.Uid) as EntStaffTab; if (item != null) { ((INWindow)this.dataService.INWindow).ContentTab.SelectedItem = item; } else { item = new EntStaffTab(this.staff); item.SetDefaultStyle(); ((INWindow)this.dataService.INWindow).ContentTab.Items.Add(item); this.dataService.AddStaffChatTab(this.staff.Uid, item); ((INWindow)this.dataService.INWindow).ContentTab.SelectedItem = item; } } }
private void CommonEvent(CommonResponse response) { if (response != null) { EntStaffTab item = this.dataService.GetStaffChatTab((long)((ulong)Jid.GetUid(response.from_jid))) as EntStaffTab; if (item == null) { IDKin.IM.Core.Staff staff = this.dataService.GetStaff((long)((ulong)Jid.GetUid(response.from_jid))); if (staff != null) { item = new EntStaffTab(staff); item.SetDefaultStyle(); ((INWindow)this.dataService.INWindow).ContentTab.Items.Add(item); this.dataService.AddStaffChatTab(staff.Uid, item); } } if (item != null) { this.ActiveInWindow(); this.PickUpMessageProcessor(); MessageBoxWindow mbw = this.dataModel.GetMessageBox(); if (mbw != null) { mbw.Refresh(); } this.FlashIconPorcessor(); IDKin.IM.Core.Staff staff = this.dataService.GetStaff((long)((ulong)Jid.GetUid(response.from_jid))); if (staff != null) { item.TabContent.ChatComponent.AddMessageNotice(staff.Name + "给你发送了一个震动!"); this.SelectedTab(item); item.TabContent.ChatComponent.Vibration(true); } } } }
private void FileDataRequestEvent(OfflineFileResponse response) { INWindow inWindow = this.dataService.INWindow as INWindow; if (response != null && inWindow != null) { EntStaffTab item = this.dataService.GetStaffChatTab(response.fromUid) as EntStaffTab; if (item == null) { IDKin.IM.Core.Staff staff = this.dataService.GetStaff(response.fromUid); if (staff != null) { item = new EntStaffTab(staff); item.SetFlashingStyle(); ((INWindow)this.dataService.INWindow).ContentTab.Items.Add(item); this.dataService.AddStaffChatTab(staff.Uid, item); } } if (item != null) { PersonalChatTabControl tab = item.TabContent; if (tab != null) { tab.AddReceiveHttpFile(response); if (!this.IsCurrentItem(item)) { item.SetFlashingStyle(); } } } this.PickUpMessageProcessor(); MessageBoxWindow mbw = this.dataModel.GetMessageBox(); if (mbw != null) { mbw.Refresh(); } if (inWindow.WindowState == WindowState.Minimized && item != null) { this.ActiveInWindow(); this.SelectedTab(item); } else { this.ActiveInWindow(); } this.FlashIconPorcessor(); } }