Example #1
0
 private void GroupFileDataEvent(GroupFileUploadResponse response)
 {
     try
     {
         if (response != null && response.fromUid != this.sessionService.Uid)
         {
             EntGroupTab item = this.dataService.GetEntGroupChatTab(response.gid) as EntGroupTab;
             if (item == null)
             {
                 EntGroup group = this.dataService.GetEntGroup(response.gid);
                 if (group != null)
                 {
                     item = new EntGroupTab(group);
                     item.SetFlashingStyle();
                     ((INWindow)this.dataService.INWindow).ContentTab.Items.Add(item);
                     this.dataService.AddEntGroupChatTab(group.Gid, item);
                 }
             }
             if (item != null)
             {
                 GroupChatTabControl tab = item.Content as GroupChatTabControl;
                 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 (this.inWindow.WindowState == WindowState.Minimized && item != null)
             {
                 this.ActiveInWindow();
                 this.SelectedTab(item);
             }
             else
             {
                 this.ActiveInWindow();
             }
             this.FlashIconPorcessor();
         }
     }
     catch (System.Exception ex)
     {
         ServiceUtil.Instance.Logger.Error(ex.ToString());
     }
 }
Example #2
0
 private void GroupNewMessage(IDKin.IM.Core.Message message)
 {
     EntGroupTab item = this.dataService.GetEntGroupChatTab(message.Gid) as EntGroupTab;
     if (item == null)
     {
         EntGroup group = this.dataService.GetEntGroup(message.Gid);
         if (group != null)
         {
             item = new EntGroupTab(group);
             item.SetDefaultStyle();
             ((INWindow)this.dataService.INWindow).ContentTab.Items.Add(item);
             this.dataService.AddEntGroupChatTab(group.Gid, item);
             ((INWindow)this.dataService.INWindow).ContentTab.SelectedItem = item;
         }
     }
     GroupChatTabControl tab = item.TabContent;
     if (tab != null)
     {
         tab.ChatComponent.AddMessageGroup(message, false);
         tab.ChatComponent.inputMsgBox.Focus();
     }
 }
 private void MouseDoubleClickHandler(object sender, MouseButtonEventArgs e)
 {
     try
     {
         if (WindowModel.Instance.IsOpenMessageCenterWindow())
         {
         }
         if (e.LeftButton == MouseButtonState.Pressed)
         {
             EntGroupTab item = this.dataService.GetEntGroupChatTab(this.group.Gid) as EntGroupTab;
             if (item != null)
             {
                 ((INWindow)this.dataService.INWindow).ContentTab.SelectedItem = item;
                 GroupChatTabControl chat = item.TabContent;
                 if (chat != null)
                 {
                     this.WatchMessage(chat);
                     this.WatchShieldMessage(chat);
                     this.UpdateShieldCount();
                 }
             }
             else
             {
                 item = new EntGroupTab(this.group);
                 item.SetDefaultStyle();
                 ((INWindow)this.dataService.INWindow).ContentTab.Items.Add(item);
                 this.dataService.AddEntGroupChatTab(this.group.Gid, item);
                 ((INWindow)this.dataService.INWindow).ContentTab.SelectedItem = item;
                 this.WatchMessage(item.TabContent);
                 this.WatchShieldMessage(item.TabContent);
                 this.UpdateShieldCount();
             }
         }
     }
     catch (System.Exception ex)
     {
         this.logger.Error(ex.ToString());
     }
 }