Exemple #1
0
        protected override void AggregateValue(object value, AggregationState aggregationState, params object[] args)
        {
            var sum     = aggregationState.GetValue <double>("value");
            var nextVal = TypeNormalizer.EnsureType <double>(value);

            aggregationState["value"] = sum + nextVal;
        }
Exemple #2
0
 protected override void AggregateValue(object value, AggregationState aggregationState, params object[] args)
 {
     bool val = TypeNormalizer.EnsureType<bool>(value);
     if (val)
     {
         var count = aggregationState.GetValue<int>("count");
         aggregationState["count"] = count + 1;
     }
 }
Exemple #3
0
        protected override void AggregateValue(object value, AggregationState aggregationState, object[] args)
        {
            if (!aggregationState.ContainsKey("results"))
            {
                aggregationState["results"] = new List <object>();
            }

            var pass = TypeNormalizer.EnsureType <bool>(value);

            if (pass && aggregationState.DataItem != null)
            {
                aggregationState.GetValue <List <object> >("results").Add(aggregationState.DataItem);
            }
        }
Exemple #4
0
        protected override void AggregateValue(object value, AggregationState aggregationState, params object[] args)
        {
            var val = TypeNormalizer.EnsureType <double>(value);

            if (!aggregationState.ContainsKey("value"))
            {
                aggregationState["value"] = val;
            }
            else
            {
                var min = aggregationState.GetValue <double>("value");

                if (val < min)
                {
                    min = val;
                }

                aggregationState["value"] = min;
            }
        }
Exemple #5
0
 protected override double ExtractAggregateValue(AggregationState aggregationState)
 {
     return(aggregationState.GetValue <double>("value"));
 }
 protected override bool ExtractAggregateValue(AggregationState aggregationState)
 {
     return(aggregationState.GetValue <bool>("value"));
 }
Exemple #7
0
 protected override int ExtractAggregateValue(AggregationState aggregationState)
 {
     return aggregationState.GetValue<int>("count");
 }
Exemple #8
0
 protected override IList <object> ExtractAggregateValue(AggregationState aggregationState)
 {
     return(aggregationState.GetValue <List <object> >("results"));
 }