Esempio n. 1
0
        public async Task <DictionariesReport> GetDictionariesAsync()
        {
            DictionariesReport dictionariesReport = null;

            HttpResponseMessage response = await client.GetAsync("issues/search?ps=1&facets=" + string.Join(",", dictionaries.FacetTypes) + "&additionalFields=_all");

            if (response.IsSuccessStatusCode)
            {
                dictionariesReport = await response.Content.ReadAsAsync <DictionariesReport>();
            }

            return(dictionariesReport);
        }
Esempio n. 2
0
        private async void ParamsBuilder_LoadAsync(object sender, EventArgs e)
        {
            try
            {
                Enabled = false;

                dictionariesReport = await sonarAPI.GetDictionariesAsync().ConfigureAwait(true);

                if (dictionariesReport != null)
                {
                    facetBindingSource.DataSource = dictionariesReport.Facets;

                    cmbParamTypes.SelectedItem = dictionariesReport.Facets.Find(f => f.Property == "projects");

                    Enabled = true;
                }
            }
            catch (Exception ex)
            {
                DialogResult dr;

                if (ex.InnerException.Message == "Unable to connect to the remote server")
                {
                    dr = MessageBox.Show(string.Format("SonarQube is not running at {0}", Settings.Default.SonarBaseUrl));
                }
                else
                {
                    dr = MessageBox.Show(ex.InnerException.Message);
                }

                if (dr == DialogResult.OK)
                {
                    Enabled = true;

                    Close();
                }
            }
        }