private static async Task <bool> TryGetClient(VSOClient client) { if (await client.Connect()) { return(true); } MessageBox.Show(Resources.Something_went_wrong_while_attempting_to_connect_to_VSO); return(false); }
private async void GetBuilds(VSOOutput output) { var client = new VSOClient(output); if (!await client.Connect()) { MessageBox.Show(Resources.Something_went_wrong_while_attempting_to_connect_to_VSO); return; } var builds = await client.GetBuilds(output.ProjectName, output.BuildDefinitionName); var list = builds.OrderByDescending(b => b, new VersionNumberComparer()).ToList(); list.Insert(0, string.Empty); lbBuilds.DataSource = list; }
protected override async Task <SendResult> Send(IWin32Window owner, VSOOutput vsoOutput, ImageData imageData) { var client = new VSOClient(vsoOutput); await client.Connect(); bool cancelled = false; var options = GetSendOptions(owner, vsoOutput, ref cancelled); if (!cancelled) { try { await client.CreateBug(options, imageData); } catch (Exception ex) { MessageBox.Show(string.Format(Resources.Failed_to_upload_bug, ex.Message)); return(new SendResult(Result.Failed)); } } return(new SendResult(cancelled ? Result.Canceled : Result.Success)); }