예제 #1
0
 private void AddMessage(string message)
 {
     if (!string.IsNullOrEmpty(message))
     {
         if (this.staff != null)
         {
             EntStaffTab item = this.dataService.GetStaffChatTab(this.staff.Uid) as EntStaffTab;
             if (item != null)
             {
                 item.TabContent.ChatComponent.AddMessageInputMsgBox(message);
                 item.TabContent.ChatComponent.SendMessageHandler();
             }
         }
         if (this.group != null)
         {
             EntGroupTab item2 = this.dataService.GetEntGroupChatTab(this.group.Gid) as EntGroupTab;
             if (item2 != null)
             {
                 item2.TabContent.ChatComponent.AddMessageInputMsgBox(message);
                 item2.TabContent.ChatComponent.SendMessageHandler();
             }
         }
         if (this.roster != null)
         {
             RosterTab item3 = this.dataService.GetRosterChatTab(this.roster.Uid) as RosterTab;
             if (item3 != null)
             {
                 item3.TabContent.ChatComponent.AddMessageInputMsgBox(message);
                 item3.TabContent.ChatComponent.SendMessageHandler();
             }
         }
     }
 }
 private void UserControl_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     try
     {
         if (e.LeftButton == MouseButtonState.Pressed && this.roster.Uid != this.sessionService.Uid)
         {
             RosterTab item = this.dataService.GetRosterChatTab(this.roster.Uid) as RosterTab;
             if (item != null)
             {
                 ((INWindow)this.dataService.INWindow).ContentTab.SelectedItem = item;
             }
             else
             {
                 item = new RosterTab(this.roster);
                 item.SetDefaultStyle();
                 ((INWindow)this.dataService.INWindow).ContentTab.Items.Add(item);
                 this.dataService.AddRosterChatTab(this.roster.Uid, item);
                 ((INWindow)this.dataService.INWindow).ContentTab.SelectedItem = item;
             }
         }
     }
     catch (System.Exception)
     {
     }
 }
예제 #3
0
 public void EntMessageRecordEvent(MessageRecordResponse records)
 {
     try
     {
         if (records.messageRecords != null && records.messageRecords.Count > 0)
         {
             if (records.entMessageRecordType == 4)
             {
                 this.EntStaffMessageRecordMessageCenter(records.messageRecords);
             }
             else
             {
                 if (records.entMessageRecordType == 3)
                 {
                     this.EntStaffMessageRecordChatPanel(records.messageRecords);
                 }
             }
         }
         else
         {
             if (records.messageRecords.Count == 0)
             {
                 if (records.entMessageRecordType == 4)
                 {
                     WindowModel.Instance.MsgRecordPage.ClearPage();
                 }
                 else
                 {
                     if (records.entMessageRecordType == 3)
                     {
                         INWindow inWindow = this.dataService.INWindow as INWindow;
                         if (inWindow != null)
                         {
                             EntStaffTab pctc = inWindow.ContentTab.SelectedItem as EntStaffTab;
                             EntGroupTab gctc = inWindow.ContentTab.SelectedItem as EntGroupTab;
                             RosterTab   rost = inWindow.ContentTab.SelectedItem as RosterTab;
                             if (pctc != null)
                             {
                                 pctc.TabContent.ChatComponent.MsgRecordComp.setShowPage();
                             }
                             if (gctc != null)
                             {
                                 gctc.TabContent.ChatComponent.MsgRecordComp.setShowPage();
                             }
                             if (rost != null)
                             {
                                 rost.TabContent.ChatComponent.MsgRecordComp.setShowPage();
                             }
                         }
                     }
                 }
             }
         }
     }
     catch (System.Exception e)
     {
         System.Console.WriteLine(e.ToString());
     }
 }
예제 #4
0
 public void CooperationStaffMessageRecordEvent(CooperationMessageRecordResponse response)
 {
     try
     {
         if (response != null || response.cooperationMessageRecord.Count != 0)
         {
             this.DisplayCooperationMessageRecordToChatPanel(response.cooperationMessageRecord, response.total);
         }
         else
         {
             if (response.cooperationMessageRecord.Count == 0)
             {
                 if (response.messageRecordType == 3)
                 {
                     INWindow inWindow = this.dataService.INWindow as INWindow;
                     if (inWindow != null)
                     {
                         EntStaffTab  pctc         = inWindow.ContentTab.SelectedItem as EntStaffTab;
                         EntGroupTab  gctc         = inWindow.ContentTab.SelectedItem as EntGroupTab;
                         RosterTab    rost         = inWindow.ContentTab.SelectedItem as RosterTab;
                         CoopStaffTab coopStaffTab = inWindow.ContentTab.SelectedItem as CoopStaffTab;
                         if (pctc != null)
                         {
                             pctc.TabContent.ChatComponent.MsgRecordComp.setShowPage();
                         }
                         if (gctc != null)
                         {
                             gctc.TabContent.ChatComponent.MsgRecordComp.setShowPage();
                         }
                         if (rost != null)
                         {
                             rost.TabContent.ChatComponent.MsgRecordComp.setShowPage();
                         }
                         if (coopStaffTab != null)
                         {
                             coopStaffTab.TabContent.ChatComponent.MsgRecordComp.setShowPage();
                         }
                     }
                 }
             }
         }
     }
     catch (System.Exception e)
     {
         System.Console.WriteLine(e.ToString());
     }
 }
        private void RosterNewMessage(Message msg)
        {
            RosterTab item = this.dataService.GetRosterChatTab((long)((ulong)Jid.GetUid(msg.FromJid))) as RosterTab;

            if (item == null)
            {
                Roster roster = this.dataService.GetRoster((long)((ulong)Jid.GetUid(msg.FromJid)));
                if (roster != null)
                {
                    item = new RosterTab(roster);
                    item.SetDefaultStyle();
                    ((INWindow)this.dataService.INWindow).ContentTab.Items.Add(item);
                    this.dataService.AddRosterChatTab(roster.Uid, item);
                }
            }
            this.baseTab = item;
            FriendsChatTabControl tab = item.TabContent;

            if (tab != null)
            {
                tab.ChatComponent.AddMessageRoster(msg, false);
                tab.ChatComponent.inputMsgBox.Focus();
            }
        }