public virtual void SendChar(char c) { //System.Diagnostics.Debug.WriteLine("SendChar: " + (int) c); if (c == (char)8 && BackspaceDeleteMode) { c = (char)127; } SendBuffer.Add(c); ReadyToSend?.Invoke(this, new EventArgs()); }
/// <summary> /// Convert a UTF string to ASCII data and send it to the output port. /// </summary> /// <param name="Text">Text to transmit</param> public virtual void SendString(string Text) { for (int i = 0; i < Text.Length; i++) { SendBuffer.Add(Text[i]); ReadyToSend?.Invoke(this, new EventArgs()); while (SendBuffer.Count > 255) { System.Windows.Forms.Application.DoEvents(); } } }
//Moje metody------------------------------- public void SetReadyToSend(bool val) //Metoda ustawiająca wartość i kolor czekboksa ReadyToSend { if (val == false) { ReadyToSend.Invoke(new Action(() => ReadyToSend.Checked = false)); ReadyToSend.Invoke(new Action(() => ReadyToSend.BackColor = Color.Crimson)); } else { ReadyToSend.Invoke(new Action(() => ReadyToSend.Checked = true)); ReadyToSend.Invoke(new Action(() => ReadyToSend.BackColor = Color.SpringGreen)); } }