Exemple #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);
            }
        }
Exemple #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);
 }
Exemple #3
0
 protected object Calculate(DataGridAggregate <TItem> aggregate, DataGridColumn <TItem> column)
 => aggregate?.AggregationFunction?.Invoke(Data, column);