Пример #1
0
        private void DownloadMetadata()
        {
            if (!CheckUrlTextField())
            {
                return;
            }
            if (string.IsNullOrWhiteSpace(folderBrowserDialog1.SelectedPath) || !Directory.Exists(folderBrowserDialog1.SelectedPath))
            {
                if (DialogResult.OK != folderBrowserDialog1.ShowDialog())
                {
                    return;
                }
            }
            if (!Directory.Exists(folderBrowserDialog1.SelectedPath))
            {
                labelStatus.Text = $"{folderBrowserDialog1.SelectedPath} does not exist.";
                return;
            }

            btnGraph.Enabled     = false;
            btnDumpMetadata.Text = CANCEL;
            if (graphViewer != null)
            {
                graphViewer.Close();
            }

            // Now start to run the spec dump procedures.
            metadataDownloader = new MetadataDownloader(txtBaseUrl.Text, folderBrowserDialog1.SelectedPath, cbFullSpec.Checked);

            string endpointVersion = ConfigurationManager.AppSettings["ENDPOINT_VERSION"];

            if (!string.IsNullOrWhiteSpace(endpointVersion))
            {
                metadataDownloader.EndpointVersion = endpointVersion;
            }

            // use the adal library
            StartDownloadMetadataUsingAdalAndBackgroundWorker();
        }
Пример #2
0
 private void Cleanup()
 {
     metadataDownloader   = null;
     btnDumpMetadata.Text = DOWNLOAD;
     SetButtonsEnabled();
 }