private void DownloadCompleted(DownloadFileAsyncResult e) { if (e.Error != null) { ExceptionHandler.LogException(e.Error, true); DialogResult = DialogResult.Cancel; } else if (e.Cancelled) { DialogResult = DialogResult.Cancel; if (File.Exists(m_fileName)) { try { File.Delete(m_fileName); } catch (Exception ex) { ExceptionHandler.LogException(ex, false); } } } else { DialogResult = DialogResult.OK; } Close(); }
private void DownloadCompletedCallback(DownloadFileAsyncResult e) { Invoke((MethodInvoker) delegate { DownloadCompleted(e); }); }