Example #1
0
 public void AddChat(ChatRoom room)
 {
     var r = room;
     this.Dispatcher.Invoke(new Action(() =>
     {
         var chatBarItem = new ChatBarItem(r) { Height = this.barHeight.Value };
         chatBarItem.HeaderMouseUp += ChatBarItemOnPreviewMouseUp;
         this.Items.Add(chatBarItem);
         if (room.GroupUser != null && room.GroupUser.UserName.ToLowerInvariant() == "lobby")
         {
             return;
         }
         this.SelectedItem = chatBarItem;
     }));
 }
Example #2
0
        public void AddChat(ChatControl chat)
        {
            if (!Dispatcher.CheckAccess())
            {
                Dispatcher.Invoke(new Action(() => this.AddChat(chat)));
                return;
            }
            var chatBarItem = new ChatBarItem(chat)
            {
                Height = this.barHeight.Value
            };

            chatBarItem.HeaderMouseUp += ChatBarItemOnPreviewMouseUp;
            this.Items.Add(chatBarItem);
            Sounds.PlayMessageSound();
            this.SelectedItem = chatBarItem;
        }
Example #3
0
        public void AddChat(ChatRoom room)
        {
            var r = room;

            this.Dispatcher.Invoke(new Action(() =>
            {
                var chatBarItem = new ChatBarItem(r)
                {
                    Height = this.barHeight.Value
                };
                chatBarItem.HeaderMouseUp += ChatBarItemOnPreviewMouseUp;
                this.Items.Add(chatBarItem);
                if (room.GroupUser != null && room.GroupUser.UserName.ToLowerInvariant() == "lobby")
                {
                    return;
                }
                this.SelectedItem = chatBarItem;
            }));
        }
Example #4
0
        /// <summary>
        /// This happens when a new room is created.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="room">
        /// The room.
        /// </param>
        private void LobbyCreateRoom(object sender, ChatRoom room)
        {
            var r = room;

            this.Dispatcher.Invoke(new Action(() =>
            {
                if (Items.OfType <ChatBarItem>().Any(x => x.Room.Rid == room.Rid))
                {
                    return;
                }
                var chatBarItem = new ChatBarItem(r)
                {
                    Height = this.barHeight.Value
                };
                chatBarItem.HeaderMouseUp += ChatBarItemOnPreviewMouseUp;
                this.Items.Add(chatBarItem);
                if (room.GroupUser != null && room.GroupUser.UserName.ToLowerInvariant() == "lobby")
                {
                    return;
                }

                this.SelectedItem = chatBarItem;
            }));
        }
Example #5
0
 /// <summary>
 /// This happens when a new room is created.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="room">
 /// The room.
 /// </param>
 private void LobbyCreateRoom(object sender, ChatRoom room)
 {
     var r = room;
     this.Dispatcher.Invoke(new Action(() =>
         {
             if (Items.OfType<ChatBarItem>().Any(x => x.Room.Rid == room.Rid)) return;
             var chatBarItem = new ChatBarItem(r) { Height = this.barHeight.Value };
             chatBarItem.HeaderMouseUp += ChatBarItemOnPreviewMouseUp;
             this.Items.Add(chatBarItem);
             if (room.GroupUser != null && room.GroupUser.UserName.ToLowerInvariant() == "lobby")
             {
                 return;
             }
             Sounds.PlayMessageSound();
             this.SelectedItem = chatBarItem;
         }));
 }
Example #6
0
 public void AddChat(ChatControl chat)
 {
     if (!Dispatcher.CheckAccess())
     {
         Dispatcher.Invoke(new Action(() => this.AddChat(chat)));
         return;
     }
     var chatBarItem = new ChatBarItem(chat) { Height = this.barHeight.Value };
     chatBarItem.HeaderMouseUp += ChatBarItemOnPreviewMouseUp;
     this.Items.Add(chatBarItem);
     Sounds.PlayMessageSound();
     this.SelectedItem = chatBarItem;
 }