Ejemplo n.º 1
0
        private System.Drawing.Rectangle _headerResize; // Cache desired size for commit header

        private void ReloadCommitInfo()
        {
            _RevisionHeader.BackColor = ColorHelper.MakeColorDarker(BackColor);

            showContainedInBranchesToolStripMenuItem.Checked                = AppSettings.CommitInfoShowContainedInBranchesLocal;
            showContainedInBranchesRemoteToolStripMenuItem.Checked          = AppSettings.CommitInfoShowContainedInBranchesRemote;
            showContainedInBranchesRemoteIfNoLocalToolStripMenuItem.Checked = AppSettings.CommitInfoShowContainedInBranchesRemoteIfNoLocal;
            showContainedInTagsToolStripMenuItem.Checked         = AppSettings.CommitInfoShowContainedInTags;
            showMessagesOfAnnotatedTagsToolStripMenuItem.Checked = AppSettings.ShowAnnotatedTagsMessages;

            ResetTextAndImage();

            if (string.IsNullOrEmpty(_revision.Guid))
            {
                return; //is it regular case or should throw an exception
            }
            _RevisionHeader.Text = string.Empty;
            _RevisionHeader.Refresh();
            string     error = "";
            CommitData data  = _commitDataManager.CreateFromRevision(_revision);

            if (_revision.Body == null)
            {
                _commitDataManager.UpdateCommitMessage(data, _revision.Guid, ref error);
                _revision.Body = data.Body;
            }

            ThreadPool.QueueUserWorkItem(_ => loadLinksForRevision(_revision));

            if (_sortedRefs == null)
            {
                ThreadPool.QueueUserWorkItem(_ => loadSortedRefs());
            }

            data.ChildrenGuids = _children;
            var header = _commitDataHeaderRenderer.Render(data, CommandClick != null);
            var body   = _commitDataBodyRenderer.Render(data, CommandClick != null);

            _RevisionHeader.SetXHTMLText(header);
            _RevisionHeader.Height = GetRevisionHeaderHeight();
            _revisionInfo          = body;

            UpdateRevisionInfo();
            LoadAuthorImage(data.Author ?? data.Committer);

            if (AppSettings.CommitInfoShowContainedInBranches)
            {
                ThreadPool.QueueUserWorkItem(_ => loadBranchInfo(_revision.Guid));
            }

            if (AppSettings.ShowAnnotatedTagsMessages)
            {
                ThreadPool.QueueUserWorkItem(_ => loadAnnotatedTagInfo(_revision));
            }

            if (AppSettings.CommitInfoShowContainedInTags)
            {
                ThreadPool.QueueUserWorkItem(_ => loadTagInfo(_revision.Guid));
            }
        }
Ejemplo n.º 2
0
        public void ShowCommitInfo(GitRevision revision, IReadOnlyList <ObjectId> children)
        {
            this.InvokeAsync(() =>
            {
                rtbRevisionHeader.Clear();

                var data   = _commitDataManager.CreateFromRevision(revision, children);
                var header = _commitDataHeaderRenderer.Render(data, showRevisionsAsLinks: CommandClicked != null);

                rtbRevisionHeader.SuspendLayout();
                rtbRevisionHeader.SetXHTMLText(header);
                rtbRevisionHeader.SelectionStart = 0; // scroll up
                rtbRevisionHeader.ScrollToCaret();    // scroll up
                rtbRevisionHeader.ResumeLayout(true);

                LoadAuthorImage(revision);
            }).FileAndForget();
        }