public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { if (OnDownloadUpdatedFired != null) { OnDownloadUpdatedFired.Invoke(this, downloadItem); } }
//public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) //cefsharp 71 //{ // if (downloadItem.IsInProgress) // { // currentBrowserTab.InvokeOnUiThreadIfRequired(() => // { // if (!currentBrowserTab.downloadOutputLabel.Visible) currentBrowserTab.downloadOutputLabel.Visible = true; // currentBrowserTab.downloadOutputLabel.Enabled = false; // //currentBrowserTab.downloadOutputLabel.LinkArea = new System.Windows.Forms.LinkArea(currentBrowserTab.downloadOutputLabel.Text.Length, currentBrowserTab.downloadOutputLabel.Text.Length); // currentBrowserTab.downloadOutputLabel.Text = $"Download {downloadItem.SuggestedFileName}: {((float)downloadItem.CurrentSpeed/1000000).ToString("0.00")} MB/s - {((float)downloadItem.ReceivedBytes/1000000).ToString("0.00")} MB de {((float)downloadItem.TotalBytes/1000000).ToString("0.00")} MB, destino: {downloadItem.FullPath}"; // }); // } // if (downloadItem.IsComplete) // { // currentBrowserTab.InvokeOnUiThreadIfRequired(() => // { // currentBrowserTab.downloadOutputLabel.Enabled = true; // FileInfo downloadItemFile = new FileInfo(downloadItem.FullPath); // currentBrowserTab.downloadOutputLabel.Text = $"Download {downloadItemFile.Name} concluído disponível na pasta {downloadItemFile.DirectoryName}"; // currentBrowserTab.downloadOutputLabel.Links.Add($"Download {downloadItemFile.Name} concluído disponível na pasta ".Length, downloadItemFile.DirectoryName.Length, downloadItemFile.DirectoryName); // }); // } // OnDownloadUpdatedFired?.Invoke(this, downloadItem); //} public void OnDownloadUpdated(IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { if (downloadItem.IsInProgress) { currentBrowserTab.InvokeOnUiThreadIfRequired(() => { if (!currentBrowserTab.downloadOutputLabel.Visible) { currentBrowserTab.downloadOutputLabel.Visible = true; } currentBrowserTab.downloadOutputLabel.Enabled = false; //currentBrowserTab.downloadOutputLabel.LinkArea = new System.Windows.Forms.LinkArea(currentBrowserTab.downloadOutputLabel.Text.Length, currentBrowserTab.downloadOutputLabel.Text.Length); currentBrowserTab.downloadOutputLabel.Text = $"Download {downloadItem.SuggestedFileName}: {((float)downloadItem.CurrentSpeed / 1000000).ToString("0.00")} MB/s - {((float)downloadItem.ReceivedBytes / 1000000).ToString("0.00")} MB de {((float)downloadItem.TotalBytes / 1000000).ToString("0.00")} MB, destino: {downloadItem.FullPath}"; }); } if (downloadItem.IsComplete) { currentBrowserTab.InvokeOnUiThreadIfRequired(() => { currentBrowserTab.downloadOutputLabel.Enabled = true; FileInfo downloadItemFile = new FileInfo(downloadItem.FullPath); currentBrowserTab.downloadOutputLabel.Text = $"Download {downloadItemFile.Name} concluído disponível na pasta {downloadItemFile.DirectoryName}"; currentBrowserTab.downloadOutputLabel.Links.Add($"Download {downloadItemFile.Name} concluído disponível na pasta ".Length, downloadItemFile.DirectoryName.Length, downloadItemFile.DirectoryName); }); } OnDownloadUpdatedFired?.Invoke(this, downloadItem); }
public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { if (downloadItem.IsComplete || downloadItem.IsCancelled) { OnDownloadUpdatedFired?.Invoke(this, downloadItem); } }
/// <summary> /// 当下载任务信息更新 /// </summary> public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { OnDownloadUpdatedFired?.Invoke(this, new DownloadUpdatedEventArgs { downloadItem = downloadItem, callback = callback // IDownloadItemCallback 可以控制下载任务,用于暂停下载任务、取消下载任务等 }); }
public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { updateCallback = callback; OnDownloadUpdatedFired?.Invoke(this, downloadItem); if (downloadItem.IsCancelled) { callback.Cancel(); } }
public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { OnDownloadUpdatedFired?.Invoke(this, downloadItem); if (downloadItem.IsComplete) { MessageBox.Show("Indirme Islemi tamamlandi"); File.WriteAllText(Application.StartupPath + "\\downloads", downloadItem.FullPath); } }
public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { OnDownloadUpdatedFired?.Invoke(this, downloadItem); _label.Text = downloadItem.PercentComplete.ToString() + "%"; _picin.Height = len - (downloadItem.PercentComplete * len) / 100; if (downloadItem.IsComplete) { _label.Text = "100%"; MessageBox.Show("Download Finished"); } }
public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { OnDownloadUpdatedFired?.Invoke(this, downloadItem); if (downloadItem.IsComplete) { OsEvent.Emit(replyMsgName, true, downloadItem); } else if (IsCancelled) { callback.Cancel(); IsCancelled = false; OsEvent.Emit(replyMsgName, false, downloadItem); } }
public void OnDownloadUpdated(IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { OnDownloadUpdatedFired?.Invoke(this, downloadItem); if (downloadItem.IsComplete) { List <Parse> Liste = new List <Parse>(); OpenFileDialog file = new OpenFileDialog { FileName = downloadItem.FullPath }; MainWindow main = new MainWindow(); Liste = main.Pars(file); main.Add(Liste); File.Delete(downloadItem.FullPath); } }
public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { if (downloadItem.IsComplete) { //Log.Print("Download completed! " + downloadItem.OriginalUrl); if (browser.IsPopup) { browser.GetHost().CloseBrowser(false); browser.GetHost().Dispose(); } } OnDownloadUpdatedFired?.Invoke(this, downloadItem); }
public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { mainBrowser = new Browser(); OnDownloadUpdatedFired?.Invoke(this, downloadItem); filePath = downloadItem.FullPath.ToString(); if (downloadItem.IsInProgress) { FileIsDownloading = true; } else if (downloadItem.IsComplete) { DownloadComplete = true; } else if (downloadItem.IsCancelled) { DownloadCancelled = true; } }
public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { OnDownloadUpdatedFired?.Invoke(this, downloadItem); //Debug.WriteLine(downloadItem.Id +" " + downloadItem.ReceivedBytes + " " +downloadItem.TotalBytes); if (downloadItem.IsCancelled) { } else if (downloadItem.IsComplete) { Console.WriteLine("LOADWP" + downloadItem.FullPath); //System.Windows.Forms.MessageBox.Show(downloadItem.FullPath); } /* * _bar.Dispatcher.Invoke(new Action(() => { * Debug.Print("{0}/{1} bytes", downloadItem.ReceivedBytes, downloadItem.TotalBytes); * * _bar.Maximum = downloadItem.TotalBytes; * _bar.Value = downloadItem.ReceivedBytes; * })); */ }
public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { ApplicationServiceContext.Current.GetService <ITickleService>().SendTickle(new Tickler.Tickle(Guid.Empty, Tickler.TickleType.Toast | Tickler.TickleType.Information, $"Download Successful")); OnDownloadUpdatedFired?.Invoke(this, downloadItem); }
void IDownloadHandler.OnDownloadUpdated(IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { OnDownloadUpdatedFired?.Invoke(this, downloadItem); }
public void OnDownloadUpdated(IWebBrowser ChromiumBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { OnDownloadUpdatedFired?.Invoke(this, downloadItem); }