It is really unbelievable but real. This code will not work:
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field)]
public class Range : Attribut
The answer to this problem is to use strings, which are allowed as attributes despite not being an atomic type. Don't use doubles as rounding will make the results less accurate.
public String MinimumValue
{
get
{
return minimumValueDecimal.ToString();
}
set
{
minimumValueDecimal = Decimal.Parse(value);
}
}
private decimal minimumValueDecimal;