public async Task CreateWebDataListFromGoogleResultsAsync(CancellationToken cancellationToken) { foreach (GoogleSearchResult googleResult in GoogleSearchEngine.Instance.SearchResults) { bool isPageInList = PagesList.Any(page => googleResult.Url.Contains(page.Url)); cancellationToken.ThrowIfCancellationRequested(); if (!isPageInList) { IWebDataSource dataSource = WebDataSourceFactory.CreateWebDataSource(googleResult); if (dataSource != null) { IPage page = await m_PagesMemoryCache.GetOrCreate(googleResult.Url, async() => await dataSource.ParseDataAndGetPageAsync()); cancellationToken.ThrowIfCancellationRequested(); PagesList.Add(page); OnPageAdded(page); } } } m_TimeoutTimer.Stop(); }
public void didFailLoadingWithError(WebView WebView, uint identifier, WebError error, IWebDataSource dataSource) { IWebURLResponse resp = null; resources.TryGetValue(identifier, out resp); if (resp != null) ResourceFailedLoading(resources[identifier], error); }
public void didReceiveContentLength(WebView WebView, uint identifier, uint length, IWebDataSource dataSource) { int received = (int)length; try { ResourceSizeAvailable(resources[identifier], received); } catch { } }
public static IWebDataSource CreateWebDataSource(GoogleSearchResult i_Result) { IWebDataSource webDataSource = null; Uri myUri = new Uri(i_Result.Url); switch (myUri.Host) { case "www.stackoverflow.com": case "stackoverflow.com": webDataSource = TryCreateStackoverflowWebDataSource(i_Result); break; case "docs.microsoft.com": webDataSource = TryCreateMicrosoftWebDataSource(i_Result); break; } return(webDataSource); }
public void didReceiveResponse(WebView WebView, uint identifier, WebURLResponse response, IWebDataSource dataSource) { throw new NotImplementedException(); }
public void didReceiveAuthenticationChallenge(WebView WebView, uint identifier, IWebURLAuthenticationChallenge challenge, IWebDataSource dataSource) { }
public void plugInFailedWithError(WebView WebView, WebError error, IWebDataSource dataSource) { PluginFailed(WebView, error); }
public void identifierForInitialRequest(WebView WebView, WebURLRequest request, IWebDataSource dataSource, uint identifier) { }
public WebURLRequest willSendRequest(WebView webView, uint identifier, WebURLRequest request, WebURLResponse redirectResponse, IWebDataSource dataSource) { return((WebURLRequest)willSendRequest(webView, identifier, (IWebURLRequest)request, redirectResponse, dataSource)); }
public WebURLRequest willSendRequest(WebView WebView, uint identifier, WebURLRequest request, WebURLResponse redirectResponse, IWebDataSource dataSource) { throw new NotImplementedException(); }
public void didFailLoadingWithError(WebView WebView, uint identifier, WebError error, IWebDataSource dataSource) { IWebURLResponse resp = null; resources.TryGetValue(identifier, out resp); if (resp != null) { ResourceFailedLoading(resources[identifier], error); } }
public void didFinishLoadingFromDataSource(WebView WebView, uint identifier, IWebDataSource dataSource) { ResourceLoaded(resources[identifier]); }
public IWebURLRequest willSendRequest(WebView WebView, uint identifier, IWebURLRequest request, WebURLResponse redirectResponse, IWebDataSource dataSource) { if (Owner.preferences.IgnoreSSLErrors) { request.mutableCopy().setAllowsAnyHTTPSCertificate(); } return(request); }
public IWebURLRequest willSendRequest(WebView WebView, uint identifier, IWebURLRequest request, IWebURLResponse redirectResponse, IWebDataSource dataSource) { string ret = ResourceRequestSent(request.url()); if (Owner.Preferences.IgnoreSSLErrors) { request.mutableCopy().setAllowsAnyHTTPSCertificate(); } if (string.IsNullOrEmpty(ret)) { return(null); } else { if (ret == request.url()) { return(request); } else { IWebURLRequest req = new WebURLRequestClass(); req.initWithURL(ret, _WebURLRequestCachePolicy.WebURLRequestUseProtocolCachePolicy, 60); return(req); } } }
public void plugInFailedWithError(WebView WebView, WebError error, IWebDataSource dataSource) { throw new NotImplementedException(); }
public void identifierForInitialRequest(WebView webView, WebURLRequest request, IWebDataSource dataSource, uint identifier) { identifierForInitialRequest(webView, (IWebURLRequest)request, dataSource, identifier); }
public WebURLRequest willSendRequest(WebView webView, uint identifier, WebURLRequest request, WebURLResponse redirectResponse, IWebDataSource dataSource) { return (WebURLRequest)willSendRequest(webView, identifier, (IWebURLRequest)request, redirectResponse, dataSource); }
public void didReceiveResponse(WebView WebView, uint identifier, IWebURLResponse response, IWebDataSource dataSource) { ResourceLoading(response); resources.Add(identifier, response); }
public void didFailLoadingWithError(WebView WebView, uint identifier, WebError error, IWebDataSource dataSource) { throw new NotImplementedException(); }
public IWebURLRequest willSendRequest(WebView WebView, uint identifier, IWebURLRequest request, IWebURLResponse redirectResponse, IWebDataSource dataSource) { string ret = ResourceRequestSent(request.url()); if (Owner.Preferences.IgnoreSSLErrors) request.mutableCopy().setAllowsAnyHTTPSCertificate(); if (string.IsNullOrEmpty(ret)) { return null; } else { if (ret == request.url()) { return request; } else { IWebURLRequest req = new WebURLRequestClass(); req.initWithURL(ret, _WebURLRequestCachePolicy.WebURLRequestUseProtocolCachePolicy, 60); return req; } } }
public IWebURLRequest willSendRequest(WebView WebView, uint identifier, IWebURLRequest request, WebURLResponse redirectResponse, IWebDataSource dataSource) { if (Owner.preferences.IgnoreSSLErrors) request.mutableCopy().setAllowsAnyHTTPSCertificate(); return request; }
public void didReceiveAuthenticationChallenge(WebView WebView, uint identifier, IWebURLAuthenticationChallenge challenge, IWebDataSource dataSource) { throw new NotImplementedException(); }
public void didFinishLoadingFromDataSource(WebView WebView, uint identifier, IWebDataSource dataSource) { throw new NotImplementedException(); }
public void identifierForInitialRequest(WebView WebView, IWebURLRequest request, IWebDataSource dataSource, uint identifier) { if (Owner.Preferences.IgnoreSSLErrors) { request.mutableCopy().setAllowsAnyHTTPSCertificate(); } }
public void identifierForInitialRequest(WebView WebView, IWebURLRequest request, IWebDataSource dataSource, uint identifier) { if (Owner.Preferences.IgnoreSSLErrors) request.mutableCopy().setAllowsAnyHTTPSCertificate(); }
public void didReceiveContentLength(WebView WebView, uint identifier, uint length, IWebDataSource dataSource) { throw new NotImplementedException(); }
public void identifierForInitialRequest(WebView WebView, WebURLRequest request, IWebDataSource dataSource, uint identifier) { throw new NotImplementedException(); }