private void _port_OnError(string Description) { if (ErrorEvent != null) { SerialErrors err = (SerialErrors)0; if (Description.IndexOf("Framing") >= 0) { err |= SerialErrors.Frame; } if (Description.IndexOf("Overrun") >= 0) { err |= SerialErrors.Overrun; } if (Description.IndexOf("Receive Overflow") >= 0) { err |= SerialErrors.RxOver; } if (Description.IndexOf("Parity") >= 0) { err |= SerialErrors.RxParity; } if (Description.IndexOf("Transmit Overflow") >= 0) { err |= SerialErrors.TxFull; } ErrorEvent(this, new SerialErrorEventArgs(err, Description)); } }
// Constructor. internal SerialErrorEventArgs(SerialErrors eventType) { this.eventType = eventType; }
public SerialErrorEventArgs(SerialErrors eventType, string Description) { _EventType = eventType; _Description = Description; }
public SerialErrorEventArgs(SerialErrors eventType) { _EventType = eventType; }