protected override async System.Threading.Tasks.Task Save() { var req = new Octokit.PullRequestReviewCommentCreate(Text, null, null, 0); var comment = await _applicationService.GitHubClient.PullRequest.Comment.Create(RepositoryOwner, RepositoryName, Id, req); _commendAdded.OnNext(comment); }
private void ShowCommentComposer(int line) { ShowComposer(async text => { var commentOptions = new Octokit.PullRequestReviewCommentCreate(text, _commit, _path, line); var comment = await _applicationService.GitHubClient.PullRequest.ReviewComment.Create( _username, _repository, _pullRequestId, commentOptions); _comments.Add(comment); }); }
public PullRequestCommentViewModel(IApplicationService applicationService) { Title = "Add Comment"; SaveCommand = ReactiveCommand.CreateAsyncTask( this.WhenAnyValue(x => x.Text).Select(x => !string.IsNullOrEmpty(x)), t => { var req = new Octokit.PullRequestReviewCommentCreate(Text, null, null, 0); return(applicationService.GitHubClient.PullRequest.Comment.Create(RepositoryOwner, RepositoryName, Id, req)); }); SaveCommand.Subscribe(x => Dismiss()); }