private void Progress_FormClosed(object sender, FormClosedEventArgs e) { switch (exitState) { case ProgressExitState.Exiting: exitState = ProgressExitState.Exited; callingForm.Close(); break; case ProgressExitState.NotExiting: callingForm.Show(); break; } }
private void Progress_FormClosing(object sender, FormClosingEventArgs e) { if (exitState == ProgressExitState.NotExiting) { switch (processor.State) { case ProcessorState.Busy: if (this.ShowYesNoQuestion("Cancel conversion?", "Cancelation")) { exitState = ProgressExitState.Exiting; btnCancel_Click(sender, e); } e.Cancel = true; break; case ProcessorState.Canceling: e.Cancel = true; break; case ProcessorState.Idle: e.Cancel = false; break; } } }
private void InitializeView(Form callingForm) { this.callingForm = callingForm; previousWindowState = FormWindowState.Normal; exitState = ProgressExitState.NotExiting; }