Ejemplo n.º 1
0
 void connection_DataReceived(object sender, ConnectionEventArgs e)
 {
     // we're using invoke, since it looks like this event
     // will be triggered from another thread
     textBox1.Invoke(
         new EventHandler(
             delegate
             {
                 textBox1.Text += e.Message;
             }));
 }
Ejemplo n.º 2
0
        void connection_DataReceived(object sender, ConnectionEventArgs e)
        {
            string message = e.Message;

            if (message.StartsWith("1-")) {
                message = message.Remove(0, 2);

                this.verdieping = Convert.ToInt32(message);
            }
        }
Ejemplo n.º 3
0
        private void RenesSerialDataReceived(object sender, SerialDataReceivedEventArgs e)
        {
            ConnectionEventArgs args = new ConnectionEventArgs(sPort.ReadExisting().Replace("\n", "\r\n"));

            DataReceived(this, args);
        }