Joey Fontaine wrote:
I just noticed that, when using intellisense, the DateTime.MaxValue
field has a static property icon whereas the Decimal.MaxValue field
has a constant property icon. However, when looking at the
PropertyInfo data displayed by using reflection against the types, I
can see no inherent differences between the properties.
Neither DateTime.MaxValue nor Decimal.MaxValue are properties, they're
fields (so I assume you're talking about FieldInfo). Both are public static
initonly fields.
How does microsoft determind this difference? Or, how can I determine
the difference using reflection?
This is a guess, but VS might be using the DecimalConstantAttribute
associated with the decimal field (but not the DateTime field). You can
verify this yourself by declaring
const decimal i = 0.0;
static readonly decimal i = 0.0;
These produce the same declarations except for the first one having an extra
attribute, and VS shows different icons.
--
J.