private void downloadDelegate_DecideDestinationWithSuggestedFilename(WebDownload download, string fileName) { download.setDeletesFileUponFailure(1); if (string.IsNullOrEmpty(fileName) == false) { string url = download.request().url(); if (GlobalPreferences.WillHandleDownloadsManually) { FileDownloadBeginEventArgs args = new FileDownloadBeginEventArgs(download.request().url(), fileName, download); DownloadBegin(this, args); } else { if (!(canornot == download)) { canornot = download; candownload = "yes"; } else { canornot = null; } if (!url.StartsWith("file://")) foreach (Form hello in Application.OpenForms) { if (hello.Name == "MainDownloadForm") { candownload = "no"; } } if (candownload == "yes") { MyDownloader.App.UI.MainDownloadForm newd = new MyDownloader.App.UI.MainDownloadForm(); newd.Show(); newd.downloadList1.NewFileDownload(url, fileName, true, false); } else { ((MyDownloader.App.UI.MainDownloadForm)Application.OpenForms["MainDownloadForm"]).Show(); ((MyDownloader.App.UI.MainDownloadForm)Application.OpenForms["MainDownloadForm"]).downloadList1.NewFileDownload(url, fileName, true, false); } download.cancelForResume(); } } }