Exemple #1
0
        protected override void OnPaintSubItem(SubItemPaintEventArgs paintEventArgs)
        {
            switch ((ColumnId)paintEventArgs.SubItemId)
            {
            case ColumnId.Id:
                paintEventArgs.PaintText(DataContext.Id.ToString());
                break;

            case ColumnId.Name:
            case ColumnId.Title:
                paintEventArgs.PaintText(DataContext.Title);
                break;

            case ColumnId.Summary:
                paintEventArgs.PaintText(DataContext.Summary);
                break;

            case ColumnId.Author:
                RedmineGuiUtility.PaintOptionalContent(DataContext.Author, paintEventArgs);
                break;

            case ColumnId.Project:
                RedmineGuiUtility.PaintOptionalContent(DataContext.Project, paintEventArgs);
                break;

            case ColumnId.CreatedOn:
                NewsCreatedOnColumn.OnPaintSubItem(paintEventArgs, DataContext.CreatedOn);
                break;
            }
        }
Exemple #2
0
        protected override Size OnMeasureSubItem(SubItemMeasureEventArgs measureEventArgs)
        {
            switch ((ColumnId)measureEventArgs.SubItemId)
            {
            case ColumnId.Id:
                return(measureEventArgs.MeasureText(DataContext.Id.ToString()));

            case ColumnId.Name:
            case ColumnId.Title:
                return(measureEventArgs.MeasureText(DataContext.Title));

            case ColumnId.Summary:
                return(measureEventArgs.MeasureText(DataContext.Summary));

            case ColumnId.Project:
                return(MeasureOptionalContent(DataContext.Project, measureEventArgs));

            case ColumnId.Author:
                return(MeasureOptionalContent(DataContext.Author, measureEventArgs));

            case ColumnId.CreatedOn:
                return(NewsCreatedOnColumn.OnMeasureSubItem(measureEventArgs, DataContext.CreatedOn));
            }
            return(base.MeasureSubItem(measureEventArgs));
        }