Example #1
0
 /// <summary>Create <see cref="GraphColumnExtender"/>.</summary>
 /// <param name="column">Related column.</param>
 public GraphColumnExtender(GraphColumn column)
     : base(column)
 {
     InitializeComponent();
     CreateControls();
     SubscribeToColumnEvents();
 }
Example #2
0
 /// <summary>Create <see cref="GraphColumnExtender"/>.</summary>
 /// <param name="column">Related column.</param>
 public GraphColumnExtender(GraphColumn column)
     : base(column)
 {
     InitializeComponent();
     CreateControls();
     SubscribeToColumnEvents();
 }
Example #3
0
        protected override void OnPaintSubItem(SubItemPaintEventArgs paintEventArgs)
        {
            switch ((ColumnId)paintEventArgs.SubItemId)
            {
            case ColumnId.Subject:
                DrawSubjectColumn(paintEventArgs);
                break;

            case ColumnId.Graph:
            {
                var type = Type == FakeRevisionItemType.StagedChanges ?
                           RevisionGraphItemType.Uncommitted : RevisionGraphItemType.Unstaged;
                GraphColumn.OnPaintSubItem(paintEventArgs, Graph, type);
            }
            break;

            case ColumnId.User:
            case ColumnId.Author:
            case ColumnId.Committer:
                var user = Repository.UserIdentity;
                if (user != null)
                {
                    PaintGrayText(paintEventArgs, user, UserColumn.OnPaintSubItem);
                }
                break;

            case ColumnId.Email:
            case ColumnId.AuthorEmail:
            case ColumnId.CommitterEmail:
                var usermail = Repository.Configuration.TryGetParameterValue(GitConstants.UserEmailParameter);
                if (!string.IsNullOrWhiteSpace(usermail))
                {
                    PaintGrayText(paintEventArgs, usermail, EmailColumn.OnPaintSubItem);
                }
                break;

            case ColumnId.Date:
            case ColumnId.CommitDate:
            case ColumnId.AuthorDate:
                PaintGrayText(paintEventArgs, Resources.StrUncommitted.SurroundWith('<', '>'));
                break;

            case ColumnId.Hash:
            case ColumnId.TreeHash:
                PaintGrayText(paintEventArgs, NoHash, HashColumn.OnPaintSubItem);
                break;
            }
        }
Example #4
0
        protected override void OnPaintSubItem(SubItemPaintEventArgs paintEventArgs)
        {
            switch ((ColumnId)paintEventArgs.SubItemId)
            {
            case ColumnId.Hash:
                HashColumn.OnPaintSubItem(paintEventArgs, DataContext.HashString);
                break;

            case ColumnId.TreeHash:
                TreeHashColumn.OnPaintSubItem(paintEventArgs, DataContext.TreeHashString);
                break;

            case ColumnId.Graph:
                GraphColumn.OnPaintSubItem(paintEventArgs, Graph, DataContext.IsCurrent ? RevisionGraphItemType.Current : RevisionGraphItemType.Generic);
                break;

            case ColumnId.Name:
            case ColumnId.Subject:
                SubjectColumn.OnPaintSubItem(paintEventArgs, DataContext, Graph, _drawnPointers, paintEventArgs.HoveredPart - PointerTagHitOffset);
                break;

            case ColumnId.Date:
            case ColumnId.CommitDate:
                CommitDateColumn.OnPaintSubItem(paintEventArgs, DataContext.CommitDate);
                break;

            case ColumnId.Committer:
                CommitterColumn.OnPaintSubItem(paintEventArgs, DataContext.Committer);
                break;

            case ColumnId.CommitterEmail:
                CommitterEmailColumn.OnPaintSubItem(paintEventArgs, DataContext.Committer.Email);
                break;

            case ColumnId.AuthorDate:
                AuthorDateColumn.OnPaintSubItem(paintEventArgs, DataContext.AuthorDate);
                break;

            case ColumnId.User:
            case ColumnId.Author:
                AuthorColumn.OnPaintSubItem(paintEventArgs, DataContext.Author);
                break;

            case ColumnId.AuthorEmail:
                AuthorEmailColumn.OnPaintSubItem(paintEventArgs, DataContext.Author.Email);
                break;
            }
        }
Example #5
0
        protected override Size OnMeasureSubItem(SubItemMeasureEventArgs measureEventArgs)
        {
            switch ((ColumnId)measureEventArgs.SubItemId)
            {
            case ColumnId.Hash:
                return(HashColumn.OnMeasureSubItem(measureEventArgs, DataContext.HashString));

            case ColumnId.TreeHash:
                return(TreeHashColumn.OnMeasureSubItem(measureEventArgs, DataContext.TreeHashString));

            case ColumnId.Graph:
                return(GraphColumn.OnMeasureSubItem(measureEventArgs, Graph));

            case ColumnId.Name:
            case ColumnId.Subject:
                return(SubjectColumn.OnMeasureSubItem(measureEventArgs, DataContext, Graph));

            case ColumnId.Date:
            case ColumnId.CommitDate:
                return(CommitDateColumn.OnMeasureSubItem(measureEventArgs, DataContext.CommitDate));

            case ColumnId.Committer:
                return(CommitterColumn.OnMeasureSubItem(measureEventArgs, DataContext.Committer));

            case ColumnId.CommitterEmail:
                return(CommitterEmailColumn.OnMeasureSubItem(measureEventArgs, DataContext.Committer.Email));

            case ColumnId.AuthorDate:
                return(AuthorDateColumn.OnMeasureSubItem(measureEventArgs, DataContext.AuthorDate));

            case ColumnId.User:
            case ColumnId.Author:
                return(AuthorColumn.OnMeasureSubItem(measureEventArgs, DataContext.Author));

            case ColumnId.AuthorEmail:
                return(AuthorEmailColumn.OnMeasureSubItem(measureEventArgs, DataContext.Author.Email));

            default:
                return(Size.Empty);
            }
        }
Example #6
0
        protected override Size OnMeasureSubItem(SubItemMeasureEventArgs measureEventArgs)
        {
            switch ((ColumnId)measureEventArgs.SubItemId)
            {
            case ColumnId.Hash:
                return(HashColumn.OnMeasureSubItem(measureEventArgs, NoHash));

            case ColumnId.TreeHash:
                return(TreeHashColumn.OnMeasureSubItem(measureEventArgs, NoHash));

            case ColumnId.AuthorDate:
            case ColumnId.Date:
            case ColumnId.CommitDate:
                return(measureEventArgs.MeasureText(Resources.StrUncommitted.SurroundWith('<', '>')));

            case ColumnId.Author:
            case ColumnId.Committer:
            {
                var username = _repository.Configuration.TryGetParameterValue(GitConstants.UserNameParameter);
                var usermail = _repository.Configuration.TryGetParameterValue(GitConstants.UserEmailParameter);
                return(UserColumn.OnMeasureSubItem(measureEventArgs,
                                                   username == null ? string.Empty : username, usermail == null ? string.Empty : usermail));
            }

            case ColumnId.Email:
            case ColumnId.CommitterEmail:
            case ColumnId.AuthorEmail:
            {
                var usermail = _repository.Configuration.TryGetParameter(GitConstants.UserEmailParameter);
                return(EmailColumn.OnMeasureSubItem(measureEventArgs, usermail == null ? "" : usermail.Value));
            }

            case ColumnId.Graph:
                return(GraphColumn.OnMeasureSubItem(measureEventArgs, _graph));

            default:
                return(Size.Empty);
            }
        }