예제 #1
0
        public virtual IColumnCaption GetColumnCaption(ColumnDescriptor columnDescriptor)
        {
            DisplayNameAttribute displayNameAttribute =
                columnDescriptor.GetAttributes().OfType <DisplayNameAttribute>().FirstOrDefault();

            if (null != displayNameAttribute)
            {
                return(ColumnCaption.UnlocalizableCaption(displayNameAttribute.DisplayName));
            }
            return(FormatChildDisplayName(columnDescriptor.Parent, GetBaseDisplayName(columnDescriptor)));
        }
예제 #2
0
        public IColumnCaption GetColumnCaption(PivotKey pivotKey)
        {
            IColumnCaption columnCaption;

            if (null != ColumnSpec.Caption)
            {
                columnCaption = ColumnCaption.UnlocalizableCaption(ColumnSpec.Caption);
            }
            else if (null == ColumnDescriptor)
            {
                columnCaption = ColumnCaption.UnlocalizableCaption(PropertyPath.ToString());
            }
            else
            {
                columnCaption = DataSchema.GetColumnCaption(ColumnDescriptor);
            }
            return(QualifyColumnCaption(pivotKey, columnCaption));
        }
예제 #3
0
        public static IColumnCaption MakeCaptionComponent(object part)
        {
            if (part == null)
            {
                return(EMPTY);
            }
            IColumnCaption captionComponent = part as IColumnCaption;

            if (captionComponent != null)
            {
                return(captionComponent);
            }
            var formattable = part as IFormattable;

            if (formattable != null)
            {
                return(new FormattableCaption(formattable));
            }
            return(ColumnCaption.UnlocalizableCaption(part.ToString()));
        }