//! serious system error
        public virtual void OnError(BM_TELEGRAPH_STATE ErrorState)
        {
            if (m_IfDisposed)
            {
                return;
            }

            Dispose();
            //BatteryManageTelegraphEvent.Invoke(ErrorState, m_Command);

            /*
             * BeginInvoke
             *  (
             *      SinglePhaseTelegraphEvent,
             *      this,
             *      ErrorState,
             *      m_Command
             *  );
             */
            if (null != SinglePhaseTelegraphEvent)
            {
#if __ASYN_TELEGRAPH_REPORT__
                BeginInvoke
                (
                    SinglePhaseTelegraphEvent,
                    this,
                    ErrorState,
                    m_Command
                );
#else
                SinglePhaseTelegraphEvent.Invoke(this, ErrorState, m_Command);
#endif
            }
            base.OnCancel();
        }
Example #2
0
        private void TestingSinglePhaseTelegraphEvent(SinglePhaseTelegraph tTelegraph, BM_TELEGRAPH_STATE State, ESCommand ReceivedCommand)
        {
            tTelegraph.SinglePhaseTelegraphEvent -= new SinglePhaseTelegraphEventHandler(TestingSinglePhaseTelegraphEvent);

            if (State == BM_TELEGRAPH_STATE.BM_TELE_RT_SUCCESS)
            {
                //! raising event
                OnAdapterAvailableTelegraphAutoDetectionReport
                    (TELEGRAPH_AUTO_DETECT_RESULT.ONE_TELEGRAPH_MATCHED, new String[1] {
                    tTelegraph.Type
                });
            }
            else
            {
                //! raising event
                OnAdapterAvailableTelegraphAutoDetectionReport
                    (TELEGRAPH_AUTO_DETECT_RESULT.NO_TELEGRAPH_MATCHED, null);
            }
        }