PdfRpt.Core.Helper.ApplyDataAnnotations.ApplyPropertyDataAnnotations C# (CSharp) Method

ApplyPropertyDataAnnotations() public static method

Applies Annotations to a list of PdfColumnAttributes.
public static ApplyPropertyDataAnnotations ( this bodyDataSource, IList result, bool areColumnsAdHoc = false ) : void
bodyDataSource this Data source
result IList A list of PdfColumnAttributes
areColumnsAdHoc bool It's possible to remove the MainTableColumns part completely
return void
        public static void ApplyPropertyDataAnnotations(this IDataSource bodyDataSource, IList<ColumnAttributes> result, bool areColumnsAdHoc = false)
        {
            var properties = bodyDataSource.GetPropertiesInfoOfStronglyTypedListDataSource();
            if (properties == null || !properties.Any()) return;

            var fieldsInfo = bodyDataSource.GetFieldsInfoOfStronglyTypedListDataSource();

            foreach (var property in properties)
            {
                var columnAttributes = result.FirstOrDefault(x => x.PropertyName == property.Name);
                if (columnAttributes == null) continue;

                applyPropertyName(property, columnAttributes, areColumnsAdHoc);
                applyAggregateFunction(property, columnAttributes);
                applyFixedHeight(property, columnAttributes);
                applyMinimumHeight(property, columnAttributes);
                applyCellsHorizontalAlignment(property, columnAttributes);
                applyColumnIsVisible(property, columnAttributes);
                applyOrder(property, columnAttributes);
                applyWidth(property, columnAttributes);
                applyDataFormatString(property, columnAttributes);
                applyColumnItemsTemplate(property, columnAttributes);
                applyCalculatedField(property, columnAttributes, fieldsInfo);
                applyIncludedGroupFieldEqualityComparer(property, columnAttributes, fieldsInfo);
            }
        }