Beispiel #1
0
        public IndexedPropertyDescriptor MakePropertyDescriptor(int index, ImmutableList <object> columnHeaderKey,
                                                                PropertyDescriptor originalPropertyDescriptor, IColumnCaption caption, AggregateOperation aggregateOperation)
        {
            IColumnCaption qualifiedCaption;

            if (columnHeaderKey.Count == 0)
            {
                qualifiedCaption = caption;
            }
            else
            {
                qualifiedCaption = new CaptionComponentList(columnHeaderKey.Concat(new[] { caption })
                                                            .Select(CaptionComponentList.MakeCaptionComponent));
            }
            var attributes = DataSchema.GetAggregateAttributes(originalPropertyDescriptor, aggregateOperation).ToArray();

            return(new IndexedPropertyDescriptor(DataSchema, index, aggregateOperation.GetPropertyType(originalPropertyDescriptor.PropertyType),
                                                 qualifiedCaption, attributes));
        }
Beispiel #2
0
        public static ListPropertyType GetListPropertyType(ColumnDescriptor columnDescriptor, AggregateOperation aggregateOperation)
        {
            var propertyType = columnDescriptor.DataSchema.GetWrappedValueType(columnDescriptor.PropertyType);

            if (aggregateOperation != null)
            {
                propertyType = aggregateOperation.GetPropertyType(propertyType);
            }
            if (propertyType == typeof(bool))
            {
                return(ListPropertyType.TRUE_FALSE);
            }

            if (propertyType.IsPrimitive)
            {
                return(ListPropertyType.NUMBER);
            }

            return(ListPropertyType.TEXT);
        }
Beispiel #3
0
        public IndexedPropertyDescriptor MakePropertyDescriptor(int index, ImmutableList <object> columnHeaderKey,
                                                                PropertyDescriptor originalPropertyDescriptor, IColumnCaption caption, AggregateOperation aggregateOperation)
        {
            IColumnCaption  qualifiedCaption;
            PivotedColumnId pivotedColumnId = null;

            if (columnHeaderKey.Count == 0)
            {
                qualifiedCaption = caption;
            }
            else
            {
                var pivotCaptionComponents = columnHeaderKey.Select(CaptionComponentList.MakeCaptionComponent).ToList();
                qualifiedCaption = new CaptionComponentList(pivotCaptionComponents.Append(caption));
                pivotedColumnId  = new PivotedColumnId(columnHeaderKey,
                                                       new CaptionComponentList(pivotCaptionComponents),
                                                       caption,
                                                       caption);
            }
            var attributes = DataSchema.GetAggregateAttributes(originalPropertyDescriptor, aggregateOperation).ToArray();

            return(new IndexedPropertyDescriptor(DataSchema, index, aggregateOperation.GetPropertyType(originalPropertyDescriptor.PropertyType),
                                                 qualifiedCaption, pivotedColumnId, attributes));
        }