/// <summary> /// Генерирует событие при возникновении ошибок в CAN адаптере /// </summary> private void OnErrorReceived(ERROR error) { EventHandlerErrorRecived handler = this.ErrorReceived; EventArgsLineErrorRecived args = new EventArgsLineErrorRecived(error); if (handler != null) { foreach (EventHandler SingleCast in handler.GetInvocationList()) { ISynchronizeInvoke syncInvoke = SingleCast.Target as ISynchronizeInvoke; try { if ((syncInvoke != null) && (syncInvoke.InvokeRequired)) { syncInvoke.Invoke(SingleCast, new Object[] { this, args }); } else { SingleCast(this, args); } } catch { throw; } } } }
/// <summary> /// Обработчик события аварийной ситуации от CAN-порта /// </summary> /// <param name="sender"></param> /// <param name="error"></param> private void EventHandler_CanPort_ErrorReceived(object sender, EventArgsLineErrorRecived error) { throw new NotImplementedException(); }