private void BrawlBuilder_FormClosing(object sender, FormClosingEventArgs e)
{
if (buildWorker.IsBusy)
{
// Cancel quitting, if user chooses to quit, then the background worker will do it once it cancels.
e.Cancel = true;
DialogResult result = MessageBox.Show("A build is in progress, quitting will stop the current build. Are you sure you want to quit?", "Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.No)
return;
_exiting = true;
_dontTouch = true;
SetStatus("Quitting...", true);
buildWorker.CancelAsync();
}
}