コード例 #1
0
ファイル: ProjectListItem.cs プロジェクト: oqewok/gitter
        protected override Size OnMeasureSubItem(SubItemMeasureEventArgs measureEventArgs)
        {
            switch ((ColumnId)measureEventArgs.SubItemId)
            {
            case ColumnId.Id:
                return(measureEventArgs.MeasureText(DataContext.Id.ToString()));

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

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

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

            case ColumnId.CreatedOn:
                return(DateColumn.OnMeasureSubItem(measureEventArgs, DataContext.CreatedOn));

            case ColumnId.UpdatedOn:
                return(DateColumn.OnMeasureSubItem(measureEventArgs, DataContext.UpdatedOn));

            default:
                return(Size.Empty);
            }
        }
コード例 #2
0
ファイル: IssueListItem.cs プロジェクト: kiple/gitter
        private static Size MeasureOptionalContent(DateTime?date, SubItemMeasureEventArgs measureEventArgs)
        {
            string text;

            if (!date.HasValue)
            {
                text = Resources.StrsUnassigned.SurroundWith('<', '>');
                return(measureEventArgs.MeasureText(text));
            }
            else
            {
                return(DateColumn.OnMeasureSubItem(measureEventArgs, date.Value));
            }
        }
コード例 #3
0
        protected override Size OnMeasureSubItem(SubItemMeasureEventArgs measureEventArgs)
        {
            switch ((ColumnId)measureEventArgs.SubItemId)
            {
            case ColumnId.Id:
                return(measureEventArgs.MeasureText(DataContext.Id));

            case ColumnId.Status:
                return(measureEventArgs.MeasureImageAndText(StatusImage, DataContext.Status.ToString()));

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

            case ColumnId.StartDate:
                return(DateColumn.OnMeasureSubItem(measureEventArgs, DataContext.StartDate));

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

            default:
                return(Size.Empty);
            }
        }