Ejemplo n.º 1
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(name_text.Text) && !string.IsNullOrWhiteSpace(ip_text.Text))
     {
         game g = new game();
         g.name      = name_text.Text;
         g.ipaddress = ip_text.Text;
         g.Show();
         this.Hide();
     }
 }
Ejemplo n.º 2
0
 private void Window_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         if (!string.IsNullOrWhiteSpace(name_text.Text) && !string.IsNullOrWhiteSpace(ip_text.Text))
         {
             game g = new game();
             g.name      = name_text.Text;
             g.ipaddress = ip_text.Text;
             g.Show();
             this.Hide();
         }
     }
 }