Пример #1
0
        public bool DownloadInstaller(string customerName, string installerName, IFileDownloader fileDownloader)
        {
            try
            {
                fileDownloader.DownloadFile(string.Format("http://example.com/{0}/{1}",
                                                          customerName,
                                                          installerName),
                                            _setupDestinationFile);

                return(true);
            }
            catch (WebException)
            {
                return(false);
            }
        }
Пример #2
0
 public InstallerHelper(IFileDownloader fileDownloader = null)
 {
     _fileDownloader = fileDownloader ?? new FileDownloader();
 }
Пример #3
0
 public InstallerHelper(IFileDownloader fileDownloader)
 {
     _fileDownloader = fileDownloader;
 }
Пример #4
0
 public InstallerHelper(IFileDownloader downloader = null)
 {
     _downloader = downloader ?? new FileDownloader();
 }
 public InstallerHelper(string setupDestinationFile = "", IFileDownloader fileDownloader = null)
 {
     _setupDestinationFile = setupDestinationFile;
     _fileDownloader       = fileDownloader ?? new FileDownloader();
 }
Пример #6
0
 public InstallerHelper()
 {
     FileDownloader = new FileDownloader();
 }
 public InstallerHelper(IFileDownloader _fileDownloader)
 {
     this._fileDownloader = _fileDownloader;
 }
Пример #8
0
 public InstallerHelper(string setupDestinationFile, IFileDownloader fileDownloader)
 {
     _setupDestinationFile = setupDestinationFile ?? throw new ArgumentNullException(nameof(setupDestinationFile));
     _fileDownloader       = fileDownloader ?? throw new ArgumentNullException(nameof(fileDownloader));
 }
 public InstallerHelperWithDependencyInjection(IFileDownloader fileDownloader = null)
 {
     _fileDownloader = fileDownloader ?? new FileDownloader();
 }
Пример #10
0
 public InstallerHelper(string path = null, IFileDownloader fileDownloader = null)
 {
     _setupLocationPath = path ?? @"C:/Users/Owner/desktop/setup.txt";
     _fileDownloader    = fileDownloader ?? new FileDownloader();
 }
Пример #11
0
 public InstallerHelper(string setupDestinationFile, IFileDownloader fileDownloader)
 {
     _fileDownloader       = fileDownloader;
     _setupDestinationFile = setupDestinationFile;
 }
Пример #12
0
 public InstallerHelper(IFileDownloader loader)
 {
     _downloader = loader ?? new FileDownloader();
 }