Exemple #1
0
 public Downloader(IView view)
 {
     _view = view;
     _options = new HttpDownloaderOptions("GET",
                                          Settings.Default.Timeout,
                                          Settings.Default.RangeFrom,
                                          Settings.Default.RangeTo,
                                          Settings.Default.ProxyUri,
                                          Settings.Default.ProxyPort);
 }
Exemple #2
0
        private HttpWebResponse GetHttpResponse(string url, HttpDownloaderOptions options)
        {
            var request = CreateRequestInternal(url);

            if (options.RangeFrom != 0L && options.RangeTo != 0L)
            {
                options.DownloadMode = DownloadMode.DownloadRange;
                request.AddRange((int) options.RangeFrom, (int) options.RangeTo);
            }
            else
            {
                options.DownloadMode = DownloadMode.Append;
                request.AddRange((int) options.RangeFrom);
            }

            return GetResponseInternal(request);
        }
Exemple #3
0
 public HttpDownloader(string url, HttpDownloaderOptions options)
 {
     WebFactory = new WebFactory {Options = options};
     InitCreateResponse(url);
 }
Exemple #4
0
 public WebFactory()
 {
     Options = new HttpDownloaderOptions("GET", Timeout);
 }