Esempio n. 1
0
        private void HostButton(object sender, RoutedEventArgs e)
        {
            var hostWindow = new NewChat(true, NameBox.Text);

            //this.Hide();
            hostWindow.ShowDialog();
        }
Esempio n. 2
0
 private void ConnectButton(object sender, RoutedEventArgs e)
 {
     if (Regex.IsMatch(IpBox.Text, @"^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$"))
     {
         var clientWindow = new NewChat(false, NameBox.Text, IpBox.Text);
         //this.Visibility = Visibility.Hidden;
         //this.Hide();
         clientWindow.ShowDialog();
     }
     else
     {
         MessageBox.Show("It's not an IP. Try one more time.");
     }
 }