示例#1
0
 public WebClientFactory(ILogger <WebClientFactory> logger,
                         IDownloadProgressCache downloadProgressCache,
                         IConfigurationOptions configurationService)
 {
     _logger = logger;
     _downloadProgressCache = downloadProgressCache;
     _configurationService  = configurationService;
 }
示例#2
0
 public LinksCache(ILogger <LinksCache> logger,
                   IDownloadProgressCache downloadProgressCache,
                   IOutputFileNameProvider outputFileNameProvider)
 {
     _logger = logger;
     _downloadProgressCache  = downloadProgressCache;
     _outputFileNameProvider = outputFileNameProvider;
 }
 public DownloadProgressProvider(ILogger <DownloadProgressProvider> logger,
                                 IDownloadProgressCache downloadProgressCache,
                                 IConfigurationOptions configurationService,
                                 ITextProvider textProvider)
 {
     _logger = logger;
     _downloadProgressCache = downloadProgressCache;
     _configurationService  = configurationService;
     _textProvider          = textProvider;
 }
示例#4
0
        public WebClient(IDownloadProgressCache progressCache,
                         IConfigurationOptions configurationService)
        {
            _progressCache        = progressCache;
            _configurationService = configurationService;

            if (!string.IsNullOrEmpty(_configurationService.User) && !string.IsNullOrEmpty(_configurationService.Password))
            {
                Credentials = new System.Net.NetworkCredential(_configurationService.User, _configurationService.Password);
            }
        }
        public DownloadProgressMonitor(ILogger <DownloadProgressMonitor> logger,
                                       IDownloadProgressProvider downloadProgressProvider,
                                       IConfigurationOptions configurationService,
                                       IDownloadProgressCache downloadProgressCache,
                                       ITextProvider textProvider)
        {
            _logger = logger;
            _downloadProgressProvider = downloadProgressProvider;
            _downloadProgressCache    = downloadProgressCache;
            _textProvider             = textProvider;

            _progressTimer          = new Timer(TimeSpan.FromSeconds(configurationService.MonitorPeriodInSecond).TotalMilliseconds);
            _progressTimer.Elapsed += ProgressTimer_Elapsed;
        }
示例#6
0
 public FileDownloader(ILogger <FileDownloader> logger,
                       IWebClientFactory webClientFactory,
                       IConfigurationOptions configuration,
                       ILinksCache linksCache,
                       IDownloadProgressCache downloadProgressCache,
                       INotificationService notificationService)
 {
     _logger                = logger;
     _webClientFactory      = webClientFactory;
     _configuration         = configuration;
     _linksCache            = linksCache;
     _downloadProgressCache = downloadProgressCache;
     _notificationService   = notificationService;
 }