Exemplo n.º 1
0
        protected override void OnPaintSubItem(SubItemPaintEventArgs paintEventArgs)
        {
            switch ((ColumnId)paintEventArgs.SubItemId)
            {
            case ColumnId.Hash:
                HashColumn.OnPaintSubItem(paintEventArgs, DataContext.Revision.HashString);
                break;

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

            case ColumnId.Name:
            case ColumnId.Message:
                paintEventArgs.PaintImageAndText(Image, DataContext.Message);
                break;

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

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

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

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

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

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

            case ColumnId.AuthorEmail:
                AuthorEmailColumn.OnPaintSubItem(paintEventArgs, DataContext.Revision.Author.Email);
                break;
            }
        }
Exemplo n.º 2
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;
            }
        }
Exemplo n.º 3
0
        protected override Size OnMeasureSubItem(SubItemMeasureEventArgs measureEventArgs)
        {
            switch ((ColumnId)measureEventArgs.SubItemId)
            {
            case ColumnId.Hash:
                return(HashColumn.OnMeasureSubItem(measureEventArgs, DataContext.Revision.HashString));

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

            case ColumnId.Name:
            case ColumnId.Message:
                return(measureEventArgs.MeasureImageAndText(Image, DataContext.Message));

            case ColumnId.Subject:
                return(SubjectColumn.OnMeasureSubItem(measureEventArgs, DataContext.Revision, null));

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

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

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

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

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

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

            default:
                return(Size.Empty);
            }
        }
Exemplo n.º 4
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);
            }
        }
Exemplo n.º 5
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);
            }
        }