Esempio n. 1
0
        //退出行为,注销设备,同时停止发送操作
        private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            bool isExit = true;

            if (e.CloseReason != CloseReason.ApplicationExitCall)
            {
                isExit = Utility.MsgBoxQuery("是否要退出?", "防止误操作");
            }
            e.Cancel = !isExit;
            if (isExit)
            {
                frmRX.Hide();
                Logger.hide();
                JavascriptIDE.hide();
                this.Hide();
                if (transmitStarted)
                {
                    stopTransmit();
                }
                if (DriverManager.Driver != null)
                {
                    DriverManager.FinializeDevice();
                }
                Logger.close();
                JavascriptIDE.close();
            }
        }
Esempio n. 2
0
 private void menuReleaseDevice_Click(object sender, EventArgs e)
 {
     DriverManager.FinializeDevice();
     lbDeviceStatus.Text = "设备状态-无设备连接";
 }