Interaction logic for ChatUserDetails.xaml
상속: System.Windows.Window
예제 #1
0
        public void listViewChat_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (listViewChat.SelectedIndex != -1)
            {
                // Get the selected IrcMessage object
                IrcMessage selectedMessage = (IrcMessage)listViewChat.SelectedItem;

                // Get viewer's Viewer object to attach to the new chat window
                // This also prevents chat opening of "OakBot" system messages
                // Creating new Viewer objects is handled by TwitchChatConnection on time
                var isInDatabase = colDatabase.FirstOrDefault(x => x.UserName == selectedMessage.Author);
                if (isInDatabase != null)
                {
                    // Check if the child chat window is open already
                    var isChatOpen = colChatWindows.FirstOrDefault(x => x.Viewer.UserName == isInDatabase.UserName);
                    if (isChatOpen != null)
                    {
                        isChatOpen.Activate();
                    }
                    else
                    {
                        WindowViewerChat userChat = new WindowViewerChat(this, isInDatabase);
                        colChatWindows.Add(userChat);
                        userChat.Show();
                    }
                }
            }
        }
예제 #2
0
 private void lbViewers_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (lbViewers.SelectedIndex != -1)
     {
         Viewer           selected = MainWindow.colDatabase.First(x => x.UserName.ToLower() == lbViewers.SelectedItem.ToString().ToLower());
         WindowViewerChat vwr      = new WindowViewerChat(MainWindow.instance, selected);
         vwr.Show();
     }
 }
예제 #3
0
        public void lvViewerDatabase_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (lvViewerDatabase.SelectedIndex != -1)
            {
                // Get the selected Viewer object
                Viewer selectedViewer = (Viewer)lvViewerDatabase.SelectedItem;

                // Check if the child chat window is open already
                // No need for validation as the Viewer is opened directly from the database collection
                var isChatOpen = colChatWindows.FirstOrDefault(x => x.Viewer.UserName == selectedViewer.UserName);
                if (isChatOpen != null)
                {
                    isChatOpen.Activate();
                }
                else
                {
                    WindowViewerChat userChat = new WindowViewerChat(this, selectedViewer);
                    colChatWindows.Add(userChat);
                    userChat.Show();
                }
            }
        }
예제 #4
0
        private void lvViewerDatabase_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (lvViewerDatabase.SelectedIndex != -1)
            {
                // Get the selected Viewer object
                Viewer selectedViewer = (Viewer)lvViewerDatabase.SelectedItem;

                // Check if the child chat window is open already
                // No need for validation as the Viewer is opened directly from the database collection
                var isChatOpen = colChatWindows.FirstOrDefault(x => x.Viewer.UserName == selectedViewer.UserName);
                if (isChatOpen != null)
                {
                    isChatOpen.Activate();
                }
                else
                {
                    WindowViewerChat userChat = new WindowViewerChat(this, selectedViewer);
                    colChatWindows.Add(userChat);
                    userChat.Show();
                }
            }
        }
예제 #5
0
        private void listViewChat_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (listViewChat.SelectedIndex != -1)
            {
                // Get the selected IrcMessage object
                IrcMessage selectedMessage = (IrcMessage)listViewChat.SelectedItem;

                // Get viewer's Viewer object to attach to the new chat window
                // This also prevents chat opening of "OakBot" system messages
                // Creating new Viewer objects is handled by TwitchChatConnection on time
                var isInDatabase = colDatabase.FirstOrDefault(x => x.UserName == selectedMessage.Author);
                if (isInDatabase != null)
                {
                    // Check if the child chat window is open already
                    var isChatOpen = colChatWindows.FirstOrDefault(x => x.Viewer.UserName == isInDatabase.UserName);
                    if (isChatOpen != null)
                    {
                        isChatOpen.Activate();
                    }
                    else
                    {
                        WindowViewerChat userChat = new WindowViewerChat(this, isInDatabase);
                        colChatWindows.Add(userChat);
                        userChat.Show();
                    }
                }
            }
        }
예제 #6
0
 public void DefaultGiveawayWinnerChosen(object sender, WinnerChosenEventArgs e)
 {
     BotCommands.SendAndShowMessage(string.Format("{0} has won the {1} giveaway!", e.Winner.UserName, e.Giveaway.GiveawayName));
     btnDrawWinner.IsEnabled = true;
     WindowViewerChat vc = new WindowViewerChat(this, e.Winner);
 }