AsposeVisualStudioPluginCells.GUI.ComponentWizardPage.downloadFileFromWeb C# (CSharp) Method

downloadFileFromWeb() private method

private downloadFileFromWeb ( string sourceURL, string destinationPath ) : void
sourceURL string
destinationPath string
return void
        private void downloadFileFromWeb(string sourceURL, string destinationPath)
        {
            progressBar.Visible = true;

            // do nuget download
            //IServiceProvider serviceProvider=new System.IServiceProvider;
            //var componentModel = (IComponentModel)GetService(typeof(SComponentModel));
            //IVsPackageInstallerServices installerServices = componentModel.GetService<IVsPackageInstallerServices>();
            //var installedPackages = installerServices.GetInstalledPackages();
            //Console.WriteLine(installedPackages.FirstOrDefault().Title);


            WebClient webClient = new WebClient();
            webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
            webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
            Uri url = new Uri("http://packages.nuget.org/api/v1/package/" + asyncActiveDownload.Component.get_name());
            webClient.DownloadFileAsync(url, destinationPath);
        }