// Log sent line to console
 private void NewLineSent(object sender, NewLineEvent.NewLineArgs e)
 {
     Console.WriteLine(@"Sent > " + e.Command.CommandString());
 }
 // Log received line to console
 private void NewLineReceived(object sender, NewLineEvent.NewLineArgs e)
 {
     Console.WriteLine(@"Received > " + e.Command.CommandString());
 }
Beispiel #3
0
 public static void NewLineSent(object sender, NewLineEvent.NewLineArgs e)
 {
     //// Log data to text box
     var message = e.Command.CommandString();
     WriteLine(IdentSt + "Sent > " + Silence(message));
 }
Beispiel #4
0
 /// <summary> Helper function to Invoke or directly call event. </summary>
 /// <param name="newLineHandler"> The event handler. </param>
 /// <param name="newLineArgs"></param>
 private void InvokeNewLineEvent(NewLineEvent.NewLineHandler newLineHandler, NewLineEvent.NewLineArgs newLineArgs)
 {
     try
     {
         if (newLineHandler == null) return;
         if (_controlToInvokeOn != null && _controlToInvokeOn.InvokeRequired)
         {
             //Asynchronously call on UI thread
             _controlToInvokeOn.Invoke((MethodInvoker)(() => newLineHandler(this, newLineArgs)));
         }
         else
         {
             //Directly call
             newLineHandler(this, newLineArgs);
         }
     }
     catch (Exception)
     {
     }
 }
Beispiel #5
0
 public static void NewLineReceived(object sender, NewLineEvent.NewLineArgs e)
 {
     var message = e.Command.CommandString();
     //var message = CmdMessenger.CurrentReceivedLine;
     WriteLine(IdentSt + "Received > " + Silence(message));
 }