private void UpdatePullRequestDescription() { if (ddlRepositorySource.SelectedValue == null || ddlRepositoryTarget.SelectedValue == null || ddlBranchSource.Tag == null || ddlBranchTarget.Tag == null) { return; } var getCommitsInBetween = new GetInBetweenCommitsRequest( (Repository)ddlRepositorySource.SelectedValue, (Repository)ddlRepositoryTarget.SelectedValue, (Commit)ddlBranchSource.Tag, (Commit)ddlBranchTarget.Tag, _settings); var result = getCommitsInBetween.Send(); if (result.Success) { var sb = new StringBuilder(); sb.AppendLine(); foreach (var commit in result.Result) { if (!commit.IsMerge) { sb.Append("* ").AppendLine(commit.Message); } } txtDescription.Text = sb.ToString(); } }
private async Task UpdatePullRequestDescriptionAsync() { await this.SwitchToMainThreadAsync(); if (ddlRepositorySource.SelectedValue is null || ddlRepositoryTarget.SelectedValue is null || ddlBranchSource.Tag is null || ddlBranchTarget.Tag is null) { return; } var getCommitsInBetween = new GetInBetweenCommitsRequest( (Repository)ddlRepositorySource.SelectedValue, (Repository)ddlRepositoryTarget.SelectedValue, (Commit)ddlBranchSource.Tag, (Commit)ddlBranchTarget.Tag, _settings); var result = await getCommitsInBetween.SendAsync(); if (result.Success) { await this.SwitchToMainThreadAsync(); var sb = new StringBuilder(); sb.AppendLine(); foreach (var commit in result.Result) { if (!commit.IsMerge) { sb.Append("* ").AppendLine(commit.Message); } } txtDescription.Text = sb.ToString(); } }