Esempio n. 1
0
        public DownloadFactory(Func <DownloadServiceImplementation, IDownloadService> factory)
        {
            this.factory = factory;
            DownloadServiceImplementation downloadServiceImplementation = DownloadServiceImplementation.RestSharp;

            if (Enum.TryParse <DownloadServiceImplementation>(AppSettingsProvider.AppSettings.DownloadService, true, out var libraryFromSettings))
            {
                downloadServiceImplementation = libraryFromSettings;
            }

            this.defaultDownloadService = downloadServiceImplementation;
        }
Esempio n. 2
0
 public IDownloadService GetDownloadService(DownloadServiceImplementation library) => factory(library);