void ProgressForm_Ended()
{
if (WaitObject != null)
{
lock (WaitObject)
{
Monitor.Wait(WaitObject);
}
}
for (int n = 0; n < 2; n++ )
{
if (!Visible) return;
try
{
BeginInvoke(new Action(delegate()
{
/*
try
{
}
catch
{
}
*/
//DialogResult property to be set to DialogResult.Cancel
DialogResult = Cancelled ? DialogResult.Cancel : DialogResult.OK;
Close();
}));
}
catch
{
}
Thread.Sleep(20);
}
}