示例#1
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="frmMain"></param>
        public ReadWriteIdHandle(FormMain frmMain)
        {
            ReadWriteIdHandleInfo.ReadConfig();
            checkDeviceInterval = ReadWriteIdHandleInfo.CheckDeviceInterval;

            this.frmMain    = frmMain;
            flagDisplayUart = true;
            sp = SerialPortFactory.GetSerialPort();
            sp.DataReceived += Sp_DataReceived;
            SpOpen();
        }
示例#2
0
 /// <summary>
 /// 应用程序关闭前触发事件
 /// 执行程序的善后操作
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void Application_ApplicationExit(object sender, EventArgs e)
 {
     //Bartender_8_01.GetBartender().CloseBartender();
     SerialPortFactory.GetSerialPort().Close();
 }
示例#3
0
 /// <summary>
 /// 应用程序关闭前触发事件
 /// 执行程序的善后操作
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void Application_ApplicationExit(object sender, EventArgs e)
 {
     SerialPortFactory.GetSerialPort().Close();
 }