コード例 #1
0
        public async Task <GitComment> EditPullRequestComment(long id, GitComment comment)
        {
            var response = await _bitbucketClient.PullRequestsClient.EditPullRequestComment(
                _gitWatcher.ActiveRepo.Name,
                _gitWatcher.ActiveRepo.Owner,
                id,
                comment.Id,
                comment.Content.Html,
                comment.Version
                );

            return(response.MapTo <GitComment>());
        }
コード例 #2
0
        public async Task <GitComment> AddPullRequestComment(long id, GitComment comment)
        {
            var response = await _bitbucketClient.PullRequestsClient.AddPullRequestComment(
                _gitWatcher.ActiveRepo.Name,
                _gitWatcher.ActiveRepo.Owner,
                id,
                comment.Content.Html,
                comment.Inline?.From,
                comment.Inline?.To,
                comment.Inline?.Path,
                comment.Parent?.Id);

            return(response.MapTo <GitComment>());
        }
コード例 #3
0
        private static bool ShowSelectedThing(ItemsControl parentContainer, GitComment objectToFind)
        {
            if (objectToFind == null)
            {
                return(false);
            }

            // check current level of tree
            foreach (ICommentTree item in parentContainer.Items)
            {
                TreeViewItem currentContainer = (TreeViewItem)parentContainer.ItemContainerGenerator.ContainerFromItem(item);
                if ((currentContainer != null) && (item.Comment.Id == objectToFind.Id))
                {
                    currentContainer.BringIntoView();
                    return(true);
                }
            }
            // item is not found at current level, check the kids
            foreach (ICommentTree item in parentContainer.Items)
            {
                TreeViewItem currentContainer = (TreeViewItem)parentContainer.ItemContainerGenerator.ContainerFromItem(item);
                if ((currentContainer != null) && (currentContainer.Items.Count > 0))
                {
                    // Have to expand the currentContainer or you can't look at the children
                    currentContainer.IsExpanded = true;
                    currentContainer.UpdateLayout();
                    if (!ShowSelectedThing(currentContainer, objectToFind))
                    {
                        // Haven't found the thing, so collapse it back
                        currentContainer.IsExpanded = false;
                    }
                    else
                    {
                        // We found the thing
                        return(true);
                    }
                }
            }
            // default
            return(false);
        }
コード例 #4
0
        private void WrapComment(GitComment comment, Theme currentTheme)
        {
            var foregroundColor = currentTheme == Theme.Light ? "black" : "white";

            comment.Content.DisplayHtml = $"<body style='background-color:transparent;color:{foregroundColor};font-size:13px'>" + comment.Content.Html + "</body>";
        }
コード例 #5
0
 public CommentTree(GitComment comment)
 {
     Comment    = comment;
     Comments   = new List <ICommentTree>();
     IsExpanded = true;
 }
コード例 #6
0
 public ObjectTree(string path, GitComment gitComment)
 {
     Path       = path;
     GitComment = gitComment;
 }