private void Window_client_Closing(object sender, System.ComponentModel.CancelEventArgs e) { try { SAPPTcpClient.Disconnect(); } catch (Exception ex) { SAPPTcpClient.logger.Error(ex, ex.Message); } }
private void TextBox_command_KeyUp(object sender, KeyEventArgs e) { try { string outText = ""; if (e.Key == Key.Enter) { outText = Json.GenerateString(new Command(textBox_command.Text)); SAPPTcpClient.Send(SAPPTcpClient.clientSocket, outText); textBox_command.Text = ""; } } catch (Exception ex) { SAPPTcpClient.Disconnect(); if (e.Key == Key.Enter) { textBox_command.Text = ""; } SAPPTcpClient.logger.Error(ex, ex.Message); } }
private void Button_disconnect_Click(object sender, RoutedEventArgs e) { SAPPTcpClient.Disconnect(); }