E
Edward Diener
I have a number of questions regarding the DefaultValueAttribute which
is not explained in the rather terse MSDN documentation for it:
1) Should I use it for all properties, even when the property is
initialized to its equivalent 0 value and I do not specifically
initialized in the constructor of my component in which the property
resides ?
2) Is the default value always a constant expression ?
3) Is it used for reference types ? How ? A reference type is not a
constant value.
4) Can it be used for enumerated types ? How ? Is the constructor taking
an Object applied when used for an enumerated type ?
5) Can it be used for the string type, which is a reference type,
passing it a string constant ?
is not explained in the rather terse MSDN documentation for it:
1) Should I use it for all properties, even when the property is
initialized to its equivalent 0 value and I do not specifically
initialized in the constructor of my component in which the property
resides ?
2) Is the default value always a constant expression ?
3) Is it used for reference types ? How ? A reference type is not a
constant value.
4) Can it be used for enumerated types ? How ? Is the constructor taking
an Object applied when used for an enumerated type ?
5) Can it be used for the string type, which is a reference type,
passing it a string constant ?