//try to connect to robot after network settings change private void NetworkSettingsUpdated(object sender, RoutedEventArgs e) { try { string nao_ip_address = TextBoxNaoIP.Text; int nao_port = Int32.Parse(TextBoxNaoPort.Text); ConnectButton.IsEnabled = false; ConnectButton.Content = "Connecting..."; ConnectToNaoDelegate connector = new ConnectToNaoDelegate(this.ConnectToNao); connector.BeginInvoke(nao_ip_address, nao_port, null, null); } catch (FormatException) { //the field colors red magically } }
private void NetworkSettingsUpdated(object sender, RoutedEventArgs e) { try { string nao_ip_address = TextBoxNaoIP.Text; int nao_port = Int32.Parse(TextBoxNaoPort.Text); ConnectButton.IsEnabled = false; ConnectButton.Content = "Connecting..."; ConnectToNaoDelegate connector = new ConnectToNaoDelegate(this.ConnectToNao); connector.BeginInvoke(nao_ip_address, nao_port, null, null); } catch (FormatException) { //the field colors red magically } }