Example #1
0
        private async void TestGetProjects_Click(object sender, EventArgs e)
        {
            Models.Projects.Project projects = null;
            try
            {
                projects = await GetProjects?.Invoke();

                StringBuilder sb = new StringBuilder();
                sb.AppendLine("Authenticated projects:\n");

                foreach (var project in projects.value)
                {
                    sb.AppendLine(project.name);
                }

                MessageBox.Show(sb.ToString());
            }
            catch
            {
                MessageBox.Show($"Unable to connect to Azure DevOps - check the event viewer", "Connection error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                SetUISuccessOrFailure(false);
            }

            if (projects != null && projects.value.Count > 0)
            {
                SetUISuccessOrFailure(true);
            }
        }
Example #2
0
        private async void MainForm_Load(object sender, EventArgs e)
        {
            Models.Projects.Project projects = null;

            try
            {
                projects = await GetProjects?.Invoke();
            }
            catch
            {
                MessageBox.Show($"Unable to connect to the Azure DevOps API start up - check the event view", "Connection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                SetUISuccessOrFailure(false);
            }

            if (projects != null && projects.value.Count > 0)
            {
                SetUISuccessOrFailure(true);
            }
        }