static void timerUpdate_Tick(object sender, EventArgs e) { if (lastDownloadItem != oldDownloadItem) { DownloadManager.Update(lastDownloadItem); oldDownloadItem = lastDownloadItem; } }
internal static void Update(CefSharp.DownloadItem downloadItem) { var f = Find(downloadItem.Id); if (f != null) { f.downloadItem = downloadItem; } }
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; } }
private void DownloadHandler_OnDownloadUpdatedFired(object sender, CefSharp.DownloadItem e) { }
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); } } } }