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)
     {
     }
 }
Пример #2
0
 private void RosterNewMessage(IDKin.IM.Core.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);
             ((INWindow)this.dataService.INWindow).ContentTab.SelectedItem = item;
         }
     }
     FriendsChatTabControl tab = item.TabContent;
     if (tab != null)
     {
         tab.ChatComponent.AddMessageRoster(msg, false);
         tab.ChatComponent.inputMsgBox.Focus();
     }
 }