private void btnListen_Click(object sender, EventArgs e) { if (btnListen.Text == "Start listening") { ListenerState.listenPort = Convert.ToInt32(txtPort.Text); ListenerState.startListen = true; _frmListenerController.listen(int.Parse(txtPort.Text), chkIPv6.Checked); btnListen.Text = "Stop listening"; } else { ListenerState.startListen = false; _frmListenerController.stopListening(); btnListen.Text = "Start listening"; } }
private void btnListening(object sender, RoutedEventArgs e) { if (btnListen.Content.ToString() == "Start listening") { ListenerState.listenPort = Convert.ToInt32(txtPort.Text); ListenerState.startListen = true; _frmListenerController.listen(int.Parse(txtPort.Text), chkIPv6.IsChecked.Value); btnListen.Content = "Stop listening"; } else { ListenerState.startListen = false; _frmListenerController.stopListening(); btnListen.Content = "Start listening"; } }