Esempio n. 1
0
 static void timerUpdate_Tick(object sender, EventArgs e)
 {
     if (lastDownloadItem != oldDownloadItem)
     {
         DownloadManager.Update(lastDownloadItem);
         oldDownloadItem = lastDownloadItem;
     }
 }
Esempio n. 2
0
        internal static void Update(CefSharp.DownloadItem downloadItem)
        {
            var f = Find(downloadItem.Id);

            if (f != null)
            {
                f.downloadItem = downloadItem;
            }
        }
Esempio n. 3
0
 public void OnDownloadUpdated(CefSharp.IWebBrowser chromiumWebBrowser, CefSharp.IBrowser browser, CefSharp.DownloadItem downloadItem, CefSharp.IDownloadItemCallback callback)
 {
     if (downloadItem.IsCancelled || downloadItem.IsComplete || !downloadItem.IsInProgress || !downloadItem.IsValid)
     {
         Console.WriteLine("OnDownloadUpdated downloadItem.Id=" + downloadItem.Id + ",downloadItem.OriginalUrl=" + downloadItem.OriginalUrl);
         DownloadManager.Update(downloadItem);
         DownloadManager.Remove(downloadItem.Id);
     }
     else
     {
         lastDownloadItem = downloadItem;
     }
 }
Esempio n. 4
0
 private void DownloadHandler_OnDownloadUpdatedFired(object sender, CefSharp.DownloadItem e)
 {
 }
Esempio n. 5
0
 public void OnBeforeDownload(CefSharp.IWebBrowser chromiumWebBrowser, CefSharp.IBrowser browser, CefSharp.DownloadItem downloadItem, CefSharp.IBeforeDownloadCallback callback)
 {
     if (!callback.IsDisposed)
     {
         using (callback)
         {
             var find = DownloadManager.Find(downloadItem.OriginalUrl);
             if (find != null)
             {
                 find.Id = downloadItem.Id;
                 Console.WriteLine("OnBeforeDownload downloadItem.Id=" + downloadItem.Id + ",downloadItem.OriginalUrl=" + downloadItem.OriginalUrl);
                 find.downloadItem = downloadItem;
                 callback.Continue(find.localPathFile, false);
             }
         }
     }
 }