public ColumnInfo GetColumnInfo(Type table, String column) { var columnInfo = new ColumnInfo { ReportColumn = new ReportColumn(table, new Identifier(column)), Caption = column }; if (AnnotationDef.IsAnnotationProperty(column)) { var classMetadata = GetClassMetadata(table); columnInfo.Caption = AnnotationDef.GetColumnDisplayName(column); columnInfo.ColumnType = classMetadata.GetPropertyType(column).ReturnedClass; columnInfo.IsHidden = !_annotationDefNames.Contains( AnnotationDef.GetColumnKey(column)); } else if (RatioPropertyAccessor.IsRatioOrRdotpProperty(column)) { var classMetadata = GetClassMetadata(table); columnInfo.Caption = RatioPropertyAccessor.GetDisplayName(column); columnInfo.ColumnType = classMetadata.GetPropertyType(column).ReturnedClass; if (RatioPropertyAccessor.IsRatioGsProperty(column)) { columnInfo.Format = Formats.GLOBAL_STANDARD_RATIO; } else if (RatioPropertyAccessor.IsRatioProperty(column)) { columnInfo.Format = Formats.STANDARD_RATIO; } else if (RatioPropertyAccessor.IsRdotpProperty(column)) { columnInfo.Format = Formats.STANDARD_RATIO; } } else { PropertyInfo propertyInfo = table.GetProperty(column); columnInfo.ColumnType = propertyInfo.PropertyType; foreach (QueryColumn attr in propertyInfo.GetCustomAttributes(typeof(QueryColumn), true)) { columnInfo.Caption = attr.FullName ?? columnInfo.Caption; columnInfo.Format = attr.Format ?? columnInfo.Format; columnInfo.IsHidden = attr.IsHidden; } } return(columnInfo); }
public ISetter GetSetter(Type theClass, string propertyName) { return(new Setter(AnnotationDef.GetColumnKey(propertyName))); }