public void Handle(ReportCellProperty property, TReportCell cell) { if (!(property is TPropertyType)) { return; } this.HandleProperty((TPropertyType)property, cell); property.Processed = true; }
protected override void HandleAttribute <TSourceEntity>(ReportSchemaBuilder <TSourceEntity> builder, CustomPropertyAttribute attribute) { ReportCellProperty property = (ReportCellProperty)Activator.CreateInstance(attribute.PropertyType); if (attribute.IsHeader) { builder.AddHeaderProperties(property); } else { builder.AddProperties(property); } }
protected override void HandleAttribute <TSourceEntity>(ReportSchemaBuilder <TSourceEntity> builder, AttributeBase attribute) { ReportCellProperty property = this.GetCellProperty(attribute); if (property == null) { return; } if (attribute.IsHeader) { builder.AddHeaderProperties(property); } else { builder.AddProperties(property); } }
private ReportCellProperty GetCellProperty(AttributeBase attribute) { ReportCellProperty property = null; switch (attribute) { case AlignmentAttribute alignmentAttribute: property = new AlignmentProperty(alignmentAttribute.Alignment); break; case BoldAttribute _: property = new BoldProperty(); break; case ColorAttribute colorAttribute: property = new ColorProperty(colorAttribute.FontColor, colorAttribute.BackgroundColor); break; case DateTimeFormatAttribute dateTimeFormatAttribute: property = new DateTimeFormatProperty(dateTimeFormatAttribute.Format); break; case DecimalPrecisionAttribute decimalPrecisionAttribute: property = new DecimalPrecisionProperty(decimalPrecisionAttribute.Precision); break; case MaxLengthAttribute maxLengthAttribute: property = new MaxLengthProperty(maxLengthAttribute.MaxLength); break; case PercentFormatAttribute percentFormatAttribute: property = new PercentFormatProperty(percentFormatAttribute.Precision) { PostfixText = percentFormatAttribute.PostfixText, }; break; } return(property); }
public IReportCellsProvider <TSourceEntity> AddProperty(ReportCellProperty property) { this.Properties.Add(property); return(this); }
public void Handle(ReportCellProperty property, HtmlCell cell) { }