Provides data for the WebKitBrowser.FileDownloadBegin event.
Inheritance: System.EventArgs
        private void downloadDelegate_DidBegin(WebDownload download)
        {
            // create WebKitDownload object to handle this download and notify listeners
            WebKitDownload d = new WebKitDownload();

            downloads.Add(download, d);

            FileDownloadBeginEventArgs args = new FileDownloadBeginEventArgs(d);

            DownloadBegin(this, args);

            if (args.Cancel)
            {
                d.Cancel();
            }
        }
示例#2
0
        private void downloadDelegate_DidBegin(WebDownload download)
        {
            // create WebKitDownload object to handle this download and notify listeners
            WebKitDownload d = new WebKitDownload();
            downloads.Add(download, d);

            FileDownloadBeginEventArgs args = new FileDownloadBeginEventArgs(d);
            DownloadBegin(this, args);

            if (args.Cancel)
                d.Cancel();
        }
示例#3
0
        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();
                }
            }
        }
示例#4
0
 void browser_DownloadBegin(object sender, FileDownloadBeginEventArgs args)
 {
     DownloadForm frm = new DownloadForm(args.Download);
 }