private void ButtonCloseDialog_Click(object sender, EventArgs e) { this.ButtonCloseDialog.Enabled = false; this.m_Canceled = true; UserHitCancelEventHandler userHitCancelEvent = this.UserHitCancelEvent; if (userHitCancelEvent != null) { userHitCancelEvent(); } }
private void ProgressDialog_FormClosing(object sender, FormClosingEventArgs e) { if (((e.CloseReason == CloseReason.UserClosing) & !this.m_CloseDialogInvoked) && ((this.ProgressBarWork.Value < 100) & !this.m_Canceled)) { e.Cancel = true; this.m_Canceled = true; UserHitCancelEventHandler userHitCancelEvent = this.UserHitCancelEvent; if (userHitCancelEvent != null) { userHitCancelEvent(); } } }