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