コード例 #1
0
ファイル: Sum.cs プロジェクト: yuva2achieve/SharpDevelop
        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;
        }
コード例 #2
0
ファイル: Count.cs プロジェクト: yuva2achieve/SharpDevelop
 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;
     }
 }
コード例 #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);
            }
        }
コード例 #4
0
ファイル: Min.cs プロジェクト: yuva2achieve/SharpDevelop
        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;
            }
        }
コード例 #5
0
ファイル: Sum.cs プロジェクト: yuva2achieve/SharpDevelop
 protected override double ExtractAggregateValue(AggregationState aggregationState)
 {
     return(aggregationState.GetValue <double>("value"));
 }
コード例 #6
0
 protected override bool ExtractAggregateValue(AggregationState aggregationState)
 {
     return(aggregationState.GetValue <bool>("value"));
 }
コード例 #7
0
ファイル: Count.cs プロジェクト: yuva2achieve/SharpDevelop
 protected override int ExtractAggregateValue(AggregationState aggregationState)
 {
     return aggregationState.GetValue<int>("count");
 }
コード例 #8
0
 protected override IList <object> ExtractAggregateValue(AggregationState aggregationState)
 {
     return(aggregationState.GetValue <List <object> >("results"));
 }