async Task UpdateFileComments()
        {
            var result = new List <PullRequestReviewFileCommentViewModel>();

            if (Model.Id == 0 && session.PendingReviewId != 0)
            {
                ((PullRequestReviewModel)Model).Id = session.PendingReviewId;
            }

            foreach (var file in await session.GetAllFiles())
            {
                foreach (var thread in file.InlineCommentThreads)
                {
                    foreach (var comment in thread.Comments)
                    {
                        if (comment.PullRequestReviewId == Model.Id)
                        {
                            result.Add(new PullRequestReviewFileCommentViewModel(
                                           editorService,
                                           session,
                                           comment));
                        }
                    }
                }
            }

            FileComments = result;
            await Files.InitializeAsync(session, FilterComments);
        }
Beispiel #2
0
        public async Task Initialize()
        {
            var files = await session.GetAllFiles();

            foreach (var file in files)
            {
                foreach (var thread in file.InlineCommentThreads)
                {
                    var threadViewModel = new InlineCommentThreadViewModel(
                        session,
                        thread.Comments);

                    FileComments.Add(new DiffCommentThreadViewModel(
                                         ToString(thread.DiffMatch),
                                         thread.LineNumber,
                                         file.RelativePath,
                                         threadViewModel));
                }
            }
        }