Beispiel #1
0
        protected override Size OnMeasureSubItem(SubItemMeasureEventArgs measureEventArgs)
        {
            switch ((ColumnId)measureEventArgs.SubItemId)
            {
            case ColumnId.Name:
            case ColumnId.Committer:
                return(measureEventArgs.MeasureImageAndText(ImgUser, DataContext.Name));

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

            case ColumnId.Commits:
                return(measureEventArgs.MeasureText(DataContext.Commits.ToString()));

            default:
                return(Size.Empty);
            }
        }
Beispiel #2
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);
            }
        }