void Writer_Closing(object sender, FormClosingEventArgs e) { if (!running) return; e.Cancel = true; if (closeRequested) return; closeRequested = true; Cursor.Current = Cursors.WaitCursor; worker.CancelAsync(); foreach (Control c in Controls) { c.Enabled = false; } closer = new Initializing(); closer.Show(); }
void Reader_FormClosing(object sender, FormClosingEventArgs e) { Properties.Settings.Default.maximized = WindowState == FormWindowState.Maximized; if (mrAjax.IsBusy) { var closer = new Initializing(); closer.Show(); while (mrAjax.IsBusy) { System.Threading.Thread.Sleep(100); Application.DoEvents(); } closer.Close(); } }