Example #1
0
        private string DownloadSwidtagToFile(string filename, Uri location)
        {
            return(_request.RetryDownload(
                       (uri) =>
            {
                if (_request.ProviderServices == null)
                {
                    // during initialization, the pluggable downloader isn't available.
                    // luckily, it's built into this assembly, so we'll create and use it directly.
                    return new WebDownloader().DownloadFile(location, filename, SwidDownloadTimeout, false, DownloadRequest.As <Request>());
                }

                // otherwise, we can just use the pluggable one.
                return _request.ProviderServices.DownloadFile(location, filename, SwidDownloadTimeout, false, DownloadRequest);
            },
                       location
                       ));
        }