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(); } }
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(); } } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.mainWindow = ((DaifugoWPF.game)(target)); #line 8 "..\..\game.xaml" this.mainWindow.Loaded += new System.Windows.RoutedEventHandler(this.MainWindow_Loaded); #line default #line hidden return; case 2: this.status = ((System.Windows.Controls.TextBlock)(target)); return; case 3: this.name1 = ((System.Windows.Controls.TextBlock)(target)); return; case 4: this.name2 = ((System.Windows.Controls.TextBlock)(target)); return; case 5: this.name3 = ((System.Windows.Controls.TextBlock)(target)); return; case 6: this.name_me = ((System.Windows.Controls.TextBlock)(target)); return; case 7: this.mysp = ((System.Windows.Controls.StackPanel)(target)); return; case 8: this.sp2 = ((System.Windows.Controls.StackPanel)(target)); return; case 9: this.sp1 = ((System.Windows.Controls.StackPanel)(target)); return; case 10: this.sp3 = ((System.Windows.Controls.StackPanel)(target)); return; case 11: #line 36 "..\..\game.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; case 12: this.teisyutu = ((System.Windows.Controls.TextBlock)(target)); return; case 13: this.tsp = ((System.Windows.Controls.StackPanel)(target)); return; case 14: this.chatinp = ((System.Windows.Controls.TextBox)(target)); return; case 15: #line 40 "..\..\game.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1); #line default #line hidden return; case 16: this.reset = ((System.Windows.Controls.Button)(target)); #line 41 "..\..\game.xaml" this.reset.Click += new System.Windows.RoutedEventHandler(this.Reset_Click); #line default #line hidden return; case 17: this.chatText_Copy = ((System.Windows.Controls.TextBlock)(target)); return; case 18: this.chatText = ((System.Windows.Controls.TextBox)(target)); return; case 19: this.textBlock = ((System.Windows.Controls.TextBlock)(target)); return; case 20: this.f = ((System.Windows.Controls.Frame)(target)); return; } this._contentLoaded = true; }