コード例 #1
0
 private void c_SettingsLoaded(object sender, SettingsProvidedEventArgs e)
 {
     SetSettings(e);
     this.Visibility = Visibility.Visible;
     this.Show();
     MessageLog.LogSystemMessage("Welcome to UDP Chat!");
 }
コード例 #2
0
 private void SetSettings(SettingsProvidedEventArgs e)
 {
     try
     {
         chat = new UDPChat(e.Address, e.RPort, e.LPort, e.Name);
         MessageLog.LogUpdated += c_LogUpdated;
     }
     catch (Exception ex) { MessageLog.LogSystemMessage("Error!" + ex.Message); }
 }
コード例 #3
0
        private void SendButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                chat.SendMessage(SendTextBox.Text);

                Dispatcher.Invoke(new Action(() =>
                {
                    SendTextBox.Text = "";
                }));
            }
            catch (Exception ex) { MessageLog.LogSystemMessage("Error!" + ex.Message); }
        }