Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        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;
                }
            }
        }
Ejemplo n.º 3
0
 private void InitializeView(Form callingForm)
 {
     this.callingForm = callingForm;
     previousWindowState = FormWindowState.Normal;
     exitState = ProgressExitState.NotExiting;
 }