private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
if (objDownloads.Objects != null)
{
List<DownloadItem> downs = objDownloads.Objects.Cast<DownloadItem>().ToList();
if (downs.Any(a => a.Status == DownloadStatus.Downloading))
{
DialogResult r = MessageBox.Show("Are you sure you want to quit, there is some downloads left?",
"Quit?",
MessageBoxButtons.YesNo);
if (r == DialogResult.No)
{
e.Cancel = true;
return;
}
butRemoveAll_Click(null, null);
}
}
DownloadPluginHandler.Instance.Exit();
e.Cancel = false;
}
}