Esempio n. 1
0
 private static void FMouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     var fi = sender as FriendListItem;
     if (fi == null) return;
     var room = Program.LClient.Chatting.GetRoom(fi.ThisUser);
     var cw = Program.ChatWindows.SingleOrDefault(x => x.Id == room.RID);
     if(cw == null)
     {
         cw = new ChatWindow(room);
         Program.ChatWindows.Add(cw);
     }
     cw.Show();
 }
Esempio n. 2
0
 private static void GiMouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     var fi = sender as GroupChatListItem;
     if (fi == null) return;
     var room = Program.LClient.Chatting.GetRoom(fi.ThisRoom.GroupUser,true);
     var cw = Program.ChatWindows.SingleOrDefault(x => x.Id == room.RID);
     if(cw == null)
     {
         cw = new ChatWindow(room);
         Program.ChatWindows.Add(cw);
     }
     cw.Show();
     cw.richTextBox1.ScrollToEnd();
 }
Esempio n. 3
0
        void Chatting_eChatEvent(ChatRoom cr, Chatting.ChatEvent e, User user,object data)
        {
            Dispatcher.Invoke(new Action(() =>
            {

                    ChatWindow cw = Program.ChatWindows.FirstOrDefault(cww => cww.ID == cr.ID);
                    if (cw == null)
                    {
                        ChatWindow c = new ChatWindow(cr.ID);
                        c.Loaded += delegate
                        {
                            c.ChatEvent(cr, e, user, data);
                        };
                        Program.ChatWindows.Add(c);
                        if(cr.ID != 0)
                            c.Show();
                    }
                    else
                    {
                        if (cw.ID != 0)
                        {
                            cw.Show();
                        }
                    }
            }));
        }
Esempio n. 4
0
 void gi_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     GroupChatListItem gi = sender as GroupChatListItem;
     if (gi != null)
     {
         foreach (ChatWindow cw in Program.ChatWindows)
         {
             if (gi.ThisRoom.ID == cw.ID)
             {
                 cw.Show();
                 return;
             }
         }
         if (gi.ThisRoom.ID == 0)
         {
             ChatWindow cw = new ChatWindow(0);
             Program.ChatWindows.Add(cw);
             cw.Show();
         }
     }
 }