public static FilterModel FromProperty(IFrozenContext frozenCtx, IEnumerable <Property> props)
{
var last = props.Last();
var label = string.Join(", ", props.Select(i => i.GetLabel()).ToArray());
if (last is DateTimeProperty)
{
return(RangeFilterModel.Create(frozenCtx, label, FilterValueSource.FromProperty(props), typeof(DateTime), null, null));
}
else if (last is IntProperty)
{
return(RangeFilterModel.Create(frozenCtx, label, FilterValueSource.FromProperty(props), typeof(int), null, null));
}
else if (last is DecimalProperty)
{
return(RangeFilterModel.Create(frozenCtx, label, FilterValueSource.FromProperty(props), typeof(decimal), null, null));
}
else if (last is DoubleProperty)
{
return(RangeFilterModel.Create(frozenCtx, label, FilterValueSource.FromProperty(props), typeof(double), null, null));
}
else
{
return(SingleValueFilterModel.Create(frozenCtx, label, props));
}
}