Exemplo n.º 1
0
        /// <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;
                    }
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Обработчик события аварийной ситуации от CAN-порта
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="error"></param>
 private void EventHandler_CanPort_ErrorReceived(object sender,
                                                 EventArgsLineErrorRecived error)
 {
     throw new NotImplementedException();
 }