Exemplo n.º 1
0
        //public override int RedialLimit { get; set; } = 0;

        public override IDownloader GetDownloader()
        {
            var downloader = new Extension.Downloader.FileDownloader();

            //if (DownloadValidations != null)
            //{
            //downloader.DownloadValidation += (page) =>
            //{
            //	foreach (var downloadValidation in DownloadValidations)
            //	{
            //		downloadValidation.Validate(page);
            //	}
            //};
            //}
            return(downloader);
        }
Exemplo n.º 2
0
        public override IDownloader GetDownloader()
        {
            var downloader = new Extension.Downloader.FileDownloader();

            if (DownloadValidations != null)
            {
                downloader.DownloadValidation = page =>
                {
                    DownloadValidationResult result = DownloadValidationResult.Success;
                    foreach (var downloadValidation in DownloadValidations)
                    {
                        var r = downloadValidation.Validate(page, out result);
                        if (!r)
                        {
                            break;
                        }
                    }

                    return(result);
                };
            }
            return(downloader);
        }