Exemplo n.º 1
0
        public T Load(RequestFromWeb_v2 request)
        {
            string url = request.Url;

            if (_urlCache != null)
            {
                string urlPath = _urlCache.GetUrlPath(request.Url, request.RequestParameters);
                if (request.ReloadFromWeb || !zFile.Exists(urlPath))
                {
                    //if (!Http2.LoadToFile(request.Url, urlPath, request.RequestParameters))
                    if (!Http_v3.LoadToFile(request.Url, urlPath, request.RequestParameters))
                    {
                        return(default(T));
                    }
                }
                url = urlPath;
            }
            //if (!Http2.LoadUrl(url, request.RequestParameters))
            if (!Http_v3.LoadUrl(url, request.RequestParameters))
            {
                return(default(T));
            }
            request.LoadResult = true;
            return(_getDataFromWeb(request));
        }
Exemplo n.º 2
0
        public T Load(RequestFromWeb_v2 request, object key = null, bool refreshDocumentStore = false)
        {
            WebDataRequest_v2 <T> dataRequest = new WebDataRequest_v2 <T>(request);

            dataRequest.RefreshDocumentStore = refreshDocumentStore;
            dataRequest.Key = key;
            if (dataRequest.ReloadFromWeb || dataRequest.RefreshDocumentStore || !DocumentExists(dataRequest))
            {
                _LoadDocumentFromWeb(dataRequest);
                SaveDocument(dataRequest);
            }
            LoadDocument(dataRequest);
            return(dataRequest.Document);
        }
Exemplo n.º 3
0
 public WebDataRequest_v2(RequestFromWeb_v2 request)
     : base(request.Url, request.RequestParameters, request.ReloadFromWeb, request.LoadImage)
 {
 }