コード例 #1
0
        private void DownloadWorkloadFromWeb(VsEdition vsEdition)
        {
            try
            {
                WebClient webClient = new WebClient();
                IWebProxy webProxy  = WebRequest.DefaultWebProxy;
                webProxy.Credentials = CredentialCache.DefaultCredentials;
                webClient.Proxy      = webProxy;
                var markdownText = webClient.DownloadString((string)vsEdition.WorkloadGitHubUri);

                WorkloadProcesser.ProcessMarkDownText(markdownText, (List <Workload>)vsEdition.vsEditonWorkloads.Workloads);
                vsEdition.SaveAllWorkloadsToFile();
                Workloads = vsEdition.vsEditonWorkloads.Workloads.ToObservableCollection();
                GenerateCli(vsEdition);
            }
            catch (Exception exception)
            {
                MessageBox.Show("Error occured:" + exception.GetType().ToString() + ".Make sure internet connection is available.", "", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
        }
コード例 #2
0
 public void GenerateCli(VsEdition selectedVsEdition)
 {
     selectedVsEdition.GenerateCLICommand(selectedVsEdition.Name, SelectedFolderPath, SelectedLanguage, (bool)_isRecommendedSelected, (bool)_isOptionalSelected);
     CliText = selectedVsEdition.CliToDownload;
 }