//Callback for message receive public void handleMessage(byte[] message) { Thread.Sleep(1000); showMessageDelegate s = new showMessageDelegate(richTextBox1.AppendText); this.Invoke(s, System.Text.Encoding.UTF8.GetString(message) + Environment.NewLine); }
//Callback for message receive public void handleMessage(byte[] message) { Thread.Sleep(1000); showMessageDelegate s = new showMessageDelegate(richTextBox1.AppendText); this.Invoke(s, System.Text.Encoding.UTF8.GetString(message) + Environment.NewLine); }
private void CambioColorLetra() { Thread.Sleep(15 * 1000); showMessageDelegate s = new showMessageDelegate(setCambioTextBox1); this.Invoke(s); textBox1.Text = ""; textBox1.BackColor = Color.White; }
public void handleMessage(byte[] message) { try { Parte m = JsonConvert.DeserializeObject <Parte>(System.Text.Encoding.UTF8.GetString(message)); Console.WriteLine("--- SAP ---> " + m.nSAP); showMessageDelegate s = new showMessageDelegate(richTextBox1.AppendText); if (m.nSAP != "") { this.Invoke(s, "Station: " + m.estacion + " " + m.nSAP + " " + m.pckd + " in " + m.impresora + Environment.NewLine); } } catch (Exception e) { Console.WriteLine("Error en el objeto"); } }
public void handleMessage(byte[] message, bool error) { try { string m = System.Text.Encoding.UTF8.GetString(message); Console.WriteLine("--- Error ---> " + m); showMessageDelegate s = new showMessageDelegate(richTextBox1.AppendText); if (m != "" && error) { this.Invoke(s, "Error: " + m + Environment.NewLine); } else if (m != "" && !error) { this.Invoke(s, "Success: " + m + Environment.NewLine); } } catch (Exception e) { Console.WriteLine("Error en el objeto"); } }