void LinkContextMenu3_Click(object sender, EventArgs e) { _ownerInvoke(() => { WebKitBrowser.activationContext.Activate(); WebDownload d = new WebDownloadClass(); WebURLRequest request = new WebURLRequestClass(); request.initWithURL(owner.LastSelectedLink, _WebURLRequestCachePolicy.WebURLRequestUseProtocolCachePolicy, 60); d.initWithRequest(request, owner.downloadDelegate); owner.downloadDelegate.decideDestinationWithSuggestedFilename(d, URLToFileName(request.url())); WebKitBrowser.activationContext.Deactivate(); }); }
void ImageContextMenu3(object sender, EventArgs e) { _ownerInvoke(() => { WebKitBrowser.activationContext.Activate(); WebDownload d = new WebDownloadClass(); WebURLRequest request = new WebURLRequestClass(); request.initWithURL(FormatImageLink(owner.GetCurrentElement().GetAttribute("src")), _WebURLRequestCachePolicy.WebURLRequestUseProtocolCachePolicy, 60); d.initWithRequest(request, owner.downloadDelegate); owner.downloadDelegate.decideDestinationWithSuggestedFilename(d, URLToFileName(request.url(), true)); WebKitBrowser.activationContext.Deactivate(); }); }