Пример #1
0
 private void Window_client_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     try
     {
         SAPPTcpClient.Disconnect();
     }
     catch (Exception ex)
     {
         SAPPTcpClient.logger.Error(ex, ex.Message);
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
 private void Button_disconnect_Click(object sender, RoutedEventArgs e)
 {
     SAPPTcpClient.Disconnect();
 }