Ejemplo n.º 1
0
        public void Handle(ReportCellProperty property, TReportCell cell)
        {
            if (!(property is TPropertyType))
            {
                return;
            }

            this.HandleProperty((TPropertyType)property, cell);
            property.Processed = true;
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        public IReportCellsProvider <TSourceEntity> AddProperty(ReportCellProperty property)
        {
            this.Properties.Add(property);

            return(this);
        }
Ejemplo n.º 6
0
 public void Handle(ReportCellProperty property, HtmlCell cell)
 {
 }