Exemple #1
0
        /// <summary>
        /// TimeOut
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cpp_ReceiveComplete(object sender, EventArgs e)
        {
            CommPortProxy cpp = (CommPortProxy)sender;

            if (ReceiveTimeOutEvent != null)
            {
                ReceiveTimeOutEventArgs args = new ReceiveTimeOutEventArgs(cpp, cpp.ReceiveData);

                ReceiveTimeOutEventHandler temp = ReceiveTimeOutEvent;
                temp(this, args);
            }
        }
        private void cpps_ReceiveTimeOutEvent(object sender, ReceiveTimeOutEventArgs args)
        {
            CommPortProxy cpp = args.Source;

            byte[] datas = args.Datas;

            // 2007.03.16 Removed
            //
            //Debug.Assert (m_ActiveTask != null, "m_ActiveTask null");

            // 2007.03.04 Added check m_activeTask != null
            //
            if (m_ActiveTask != null)
            {
                m_ActiveTask.ProcessReceived(datas);
                if (Executed != null)
                {
                    EventHandler temp = Executed;
                    temp(this, null);
                }

                m_ActiveTask = null;
            }
        }