コード例 #1
0
        private void ChatAddButton_Click(object sender, RoutedEventArgs e)
        {
            ChatEntryDialog chatEntryDialog = new ChatEntryDialog();

            if (chatEntryDialog.ShowDialog() == true)
            {
                ChatGroup newChat = new ChatGroup(chatEntryDialog.ResponseName, chatEntryDialog.ResponseId);
                chatGroupList.Add(newChat);
            }
            else
            {
                //The user canceled the dialog
            }
        }
コード例 #2
0
        private void RemoveEventButton_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult response = MessageBox.Show("Remove event? \n Action cannot be undone.", "Remove Event", MessageBoxButton.YesNo, MessageBoxImage.Exclamation);

            if (response == MessageBoxResult.Yes)
            {
                ChatGroup chatGroup = (ChatGroup)ChatListBox.SelectedItem;
                chatGroup.RemoveEvent((Event)EventListBox.SelectedItem);
                ClearEventInfo();
            }
            else
            {
                //The user clicked no
            }
        }
コード例 #3
0
        private void AddEventButton_Click(object sender, RoutedEventArgs e)
        {
            EventDialog eventDialog = new EventDialog();

            if (eventDialog.ShowDialog() == true)
            {
                ChatGroup chatGroup = (ChatGroup)ChatListBox.SelectedItem;
                Event     newEvent  = new Event(eventDialog.ResponseName, eventDialog.ResponseDate, chatGroup.chatId);
                chatGroup.AddEvent(newEvent);
            }
            else
            {
                //The user canceled the dialog
            }
        }
コード例 #4
0
        private void ChatListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (ChatListBox.SelectedIndex == -1 || ChatListBox.SelectedItem == null)
            {
                DisableInfoPanel();
                return;
            }

            EnableInfoPanel();
            ChatGroup chatGroup = (ChatGroup)ChatListBox.SelectedItem;

            ChatNameTextBox.Text     = chatGroup.chatName;
            ChatIdTextBox.Text       = chatGroup.chatId.ToString();
            EventListBox.ItemsSource = chatGroup.eventList;
        }