private void tmTime_Tick(object sender, EventArgs e) { lblTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); if (Common._IsMainFormFirstShow) { return; } UploadHelp.StartUpload(); if (UploadHelp._isContinue) { if (_WaitNum >= Common._AutoReturnDelay) { foreach (Control item in pnlMain.Controls) { item.Dispose(); } OpenForm(PageState.Main); } else { _WaitNum++; lblNumber.Text = (Common._AutoReturnDelay - _WaitNum).ToString(); if (!lblNumber.Visible) { lblNumber.Visible = true; } } } else if (lblNumber.Visible) { lblNumber.Visible = false; } }
/// <summary> /// 计时器定期启动上报,不使用此计时器了 /// </summary> private void tmUpload_Tick(object sender, EventArgs e) { //等待主页面加载完参数 if (Common._IsMainFormFirstShow) { return; } UploadHelp.StartUpload(); //tmUpload.Enabled = false; //try //{ // if (!UploadHelp._isSleep) // UploadHelp.StartUpload(); // //ThirdPartyHelp.StartUpload(); //} //catch //{ //} //finally //{ // if (!UploadHelp._isSleep) // tmUpload.Enabled = true; // else // FrmParent.ParentForm.SetNewInfo("无上报数据,等待进入休眠...", false); //} }
/// <summary> /// 清理所有正在使用的资源。 /// </summary> /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> protected override void Dispose(bool disposing) { Rectangle rect = new Rectangle(); FullScreen.SetFullScreen(false, ref rect); //UnitechDSDll.CloseCamera(); SyncHelp.StopSync(); UploadHelp.StopUpload(); try { //this.DecodeApi.aDecodeSetDecodeEnable(0); //this.DecodeApi.Close(); } catch { } try { this.CamSdk.Close(); } catch { } if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); }
/// <summary> /// 清理所有正在使用的资源。 /// </summary> /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> protected override void Dispose(bool disposing) { Rectangle rect = new Rectangle(); FullScreen.SetFullScreen(false, ref rect); //Scanner.GetScanner().Close(); //Scanner.GetScanner().Unregister(); //UnitechDSDll.CloseCamera(); try { SyncHelp.StopSync(); } catch { } try { UploadHelp.StopUpload(); } catch { } if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); }
private void FrmParent_Closing(object sender, CancelEventArgs e) { Rectangle rect = new Rectangle(); FullScreen.SetFullScreen(false, ref rect); //Scanner.GetScanner().Close(); Scanner.GetScanner().Unregister(); UnitechDSDll.CloseCamera(); SyncHelp.StopSync(); UploadHelp.StopUpload(); }
/// <summary> /// 计时器定期启动上报 /// </summary> private void tmUpload_Tick(object sender, EventArgs e) { //等待主页面加载完参数 if (Common._IsMainFormFirstShow) { return; } tmUpload.Enabled = false; try { UploadHelp.StartUpload(); //ThirdPartyHelp.StartUpload(); } catch { } finally { tmUpload.Enabled = true; } }
private void btnExit_Click(object sender, EventArgs e) { if (CheckPDAPassword("010203")) { DialogResult dr = MessageBox.Show("确定要退出本系统吗?", "操作提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (dr == DialogResult.Yes) { Rectangle rect = new Rectangle(); FullScreen.SetFullScreen(false, ref rect); //UnitechDSDll.CloseCamera(); SyncHelp.StopSync(); UploadHelp.StopUpload(); //Common. WriteIsClose(); FrmParent.ParentForm.DecodeApi.aDecodeSetDecodeEnable(0); FrmParent.ParentForm.DecodeApi.Close(); FrmParent.ParentForm.CamSdk.Close(); Application.Exit(); } } }