Exemple #1
0
        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 { }
 }
Exemple #4
0
        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);
        }
Exemple #5
0
 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 plugInFailedWithError(WebView WebView, WebError error, IWebDataSource dataSource)
 {
     PluginFailed(WebView, error);
 }
 public void didReceiveAuthenticationChallenge(WebView WebView, uint identifier, IWebURLAuthenticationChallenge challenge, IWebDataSource dataSource)
 {
 }
        public void didReceiveContentLength(WebView WebView, uint identifier, uint length, IWebDataSource dataSource)
        {
            int received = (int)length;

            try
            {
                ResourceSizeAvailable(resources[identifier], received);
            }
            catch { }
        }
        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 void identifierForInitialRequest(WebView WebView, WebURLRequest request, IWebDataSource dataSource, uint identifier)
 {
 }
        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);
                }
            }
        }
Exemple #19
0
 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 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 void didReceiveResponse(WebView WebView, uint identifier, IWebURLResponse response, IWebDataSource dataSource)
 {
     ResourceLoading(response);
     resources.Add(identifier, response);
 }
 public IWebURLRequest willSendRequest(WebView WebView, uint identifier, IWebURLRequest request, WebURLResponse redirectResponse, IWebDataSource dataSource)
 {
     if (Owner.preferences.IgnoreSSLErrors)
         request.mutableCopy().setAllowsAnyHTTPSCertificate();
     return request; 
 }
Exemple #28
0
 public void didFailLoadingWithError(WebView WebView, uint identifier, WebError error, IWebDataSource dataSource)
 {
     throw new NotImplementedException();
 }
 public void didFinishLoadingFromDataSource(WebView WebView, uint identifier, IWebDataSource dataSource)
 {
     ResourceLoaded(resources[identifier]);
 }
Exemple #30
0
 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 didReceiveAuthenticationChallenge(WebView WebView, uint identifier, IWebURLAuthenticationChallenge challenge, IWebDataSource dataSource)
 {
     throw new NotImplementedException();
 }
Exemple #35
0
 public void didFinishLoadingFromDataSource(WebView WebView, uint identifier, IWebDataSource dataSource)
 {
     throw new NotImplementedException();
 }
 public void didReceiveContentLength(WebView WebView, uint identifier, uint length, IWebDataSource dataSource)
 {
     throw new NotImplementedException();
 }
Exemple #37
0
 public void didReceiveContentLength(WebView WebView, uint identifier, uint length, IWebDataSource dataSource)
 {
     throw new NotImplementedException();
 }
 public void didReceiveResponse(WebView WebView, uint identifier, WebURLResponse response, IWebDataSource dataSource)
 {
     throw new NotImplementedException();
 }
Exemple #39
0
 public void identifierForInitialRequest(WebView WebView, WebURLRequest request, IWebDataSource dataSource, uint identifier)
 {
     throw new NotImplementedException();
 }
 public void identifierForInitialRequest(WebView WebView, WebURLRequest request, IWebDataSource dataSource, uint identifier)
 {
     throw new NotImplementedException();
 }
Exemple #41
0
 public WebURLRequest willSendRequest(WebView WebView, uint identifier, WebURLRequest request, WebURLResponse redirectResponse, IWebDataSource dataSource)
 {
     throw new NotImplementedException();
 }
 public void plugInFailedWithError(WebView WebView, WebError error, IWebDataSource dataSource)
 {
     throw new NotImplementedException();
 }