string source;
object val;
PropertyValueOrigin origin;
- ConfigurationElement owner;
-
- ConfigurationProperty property;
+ readonly ConfigurationElement owner;
+ readonly ConfigurationProperty property;
internal PropertyInformation (ConfigurationElement owner, ConfigurationProperty property)
{
get {
if (origin == PropertyValueOrigin.Default) {
if (property.IsElement) {
- ConfigurationElement elem = (ConfigurationElement) Activator.CreateInstance (Type);
+ ConfigurationElement elem = (ConfigurationElement) Activator.CreateInstance (Type, true);
elem.InitFromProperty (this);
if (owner != null && owner.IsReadOnly ())
elem.SetReadOnly ();
val = elem;
origin = PropertyValueOrigin.Inherited;
}
- else if (property.IsDefaultCollection) {
- ConfigurationElementCollection col = (ConfigurationElementCollection) Activator.CreateInstance (Type);
- col.InitFromProperty (this);
- if (owner != null && owner.IsReadOnly ())
- col.SetReadOnly ();
- val = col;
- origin = PropertyValueOrigin.Inherited;
- }
else {
return DefaultValue;
}