private void Form_Closing(object sender, FormClosingEventArgs e)
{
if (CancelButton.Visible && MessageBox.Show("Background Tasks are running. Are you sure you want to close?", "Reeeally sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.No)
{
e.Cancel = true;
/*Task.Run(() =>
{
while (!OverallStatusLabel.Text.ToLowerInvariant().Contains("failed"))
System.Threading.Thread.Sleep(100);
DebugOutput.PrintLn("-----Execution of TPF/DDS Tools closing...-----");
CurrentInstance = null;
SaveProperties();
this.Close();
});*/
}
else
{
cts.Cancel();
DebugOutput.PrintLn("-----Execution of TPF/DDS Tools closing...-----");
CurrentInstance = null;
SaveProperties();
}
}