public ValueWithTreshold IAF_sum(params IValueWithTreshold[] facts) { var aggregated = new ValueWithTreshold(); foreach (var fact in facts) { aggregated.DecimalValue += fact.DecimalValue; aggregated.Treshold += fact.Treshold; } return(aggregated); }
public ValueWithTreshold IAF_sum(params Object[] items) { var casteditems = items.Select(i => SplitValueThreshold(i)).ToList(); var aggregated = new ValueWithTreshold(); foreach (var fact in casteditems) { aggregated.DecimalValue += fact.DecimalValue; aggregated.Treshold += fact.Treshold; } return(aggregated); }
public ValueWithTreshold SplitValueThreshold(Object item) { var result = new ValueWithTreshold(); if (item is decimal) { result.DecimalValue = (decimal)item; result.Treshold = 0; } if (item is ValidationParameter) { var p = (ValidationParameter)item; result = p.ValueWithTreshold; } if (item is ValueWithTreshold) { return(SplitValueThreshold(item as ValueWithTreshold)); } return(result); }
public static ValueWithTreshold GetValueWithTreshold(InstanceFact fact, string FallBackValue) { var result = new ValueWithTreshold(); if (fact == null) { fact = new InstanceFact(); fact.Value = FallBackValue; result.ObjectValue = fact.Value; result.DecimalValue = fact.Value_F; result.Treshold = 0; } else { result.ObjectValue = fact.Value; result.DecimalValue = fact.Value_F; result.Treshold = FactTreshold(fact); } return(result); }