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))); }
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)); }
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())); }