コード例 #1
0
 public static void NewLineReceived(object sender, CommandEventArgs e)
 {
     var message = e.Command.CommandString();
     //var message = CmdMessenger.CurrentReceivedLine;
     WriteLine(IdentSt + "Received > " + Silence(message));
 }
コード例 #2
0
 public static void NewLineSent(object sender, CommandEventArgs e)
 {
     //// Log data to text box
     var message = e.Command.CommandString();
     WriteLine(IdentSt + "Sent > " + Silence(message));
 }
コード例 #3
0
 void _cmdMessenger_NewLineSent(object sender, CommandEventArgs e)
 {
     Debug.WriteLine(String.Format("Sent > {0}",e.Command.CommandString()));
 }
コード例 #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(EventHandler<CommandEventArgs> newLineHandler, CommandEventArgs newLineArgs)
        {
            if (newLineHandler == null || (ControlToInvokeOn != null && ControlToInvokeOn.IsDisposed)) return;

            if (ControlToInvokeOn != null)
            {
                //Asynchronously call on UI thread
                ControlToInvokeOn.BeginInvoke((MethodInvoker)(() => newLineHandler(this, newLineArgs)));
            }
            else
            {
                //Directly call
                newLineHandler(this, newLineArgs);
            }
        }
コード例 #5
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(EventHandler<CommandEventArgs> newLineHandler, CommandEventArgs newLineArgs)
 {
     if (newLineHandler == null) return;
     newLineHandler(this, newLineArgs);
 }
コード例 #6
0
 // Log sent line to console
 private void NewLineSent(object sender, CommandEventArgs e)
 {
     Console.WriteLine(@"Sent > " + e.Command.CommandString());
 }
コード例 #7
0
 // Log received line to console
 private void NewLineReceived(object sender, CommandEventArgs e)
 {
     Console.WriteLine(@"Received > " + e.Command.CommandString());
 }
コード例 #8
0
 // Log sent line to console
 private void NewLineSent(object sender, CommandEventArgs e)
 {
     _chartForm.LogMessage(@"Sent > " + e.Command.CommandString());
    // Console.WriteLine(@"Sent > " + e.Command.CommandString());
 }
コード例 #9
0
ファイル: ArduinoController.cs プロジェクト: Onkeliroh/DSA
		/// <summary>
		/// Raised when a new line was send.
		/// </summary>
		/// <param name="sender">Sender.</param>
		/// <param name="e">E.</param>
		private static void NewLineSent (object sender, CommandEventArgs e)
		{
			#if DEBUG
			Console.WriteLine (DateTime.Now + @": Sent > " + e.Command.CommandString ());
			#endif
			if (OnSendMessage != null)
			{
				OnSendMessage.Invoke (null, new CommunicationArgs (e.Command.CommandString ()));
			}
			LastCommunication = DateTime.Now;
		}