Ejemplo n.º 1
0
        protected object Calculate(DataGridAggregate <TItem> aggregate, DataGridColumn <TItem> column)
        {
            switch (aggregate.Aggregate)
            {
            case DataGridAggregateType.Sum:
                return(SumOf(column));

            case DataGridAggregateType.Average:
                return(AverageOf(column));

            case DataGridAggregateType.Min:
                return(MinOf(column));

            case DataGridAggregateType.Max:
                return(MaxOf(column));

            case DataGridAggregateType.Count:
                return(CountOf(column));

            case DataGridAggregateType.TrueCount:
                return(TrueCountOf(column));

            case DataGridAggregateType.FalseCount:
                return(FalseCountOf(column));

            default:
                return(null);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Links the child column with this datagrid.
 /// </summary>
 /// <param name="column">Column to link with this datagrid.</param>
 internal void Hook(DataGridAggregate <TItem> aggregate)
 {
     Aggregates.Add(aggregate);
 }
Ejemplo n.º 3
0
 protected object Calculate(DataGridAggregate <TItem> aggregate, DataGridColumn <TItem> column)
 => aggregate?.AggregationFunction?.Invoke(Data, column);