X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Configuration%2FSystem.Configuration%2FPropertyInformation.cs;h=9d5662712ad43512cf778ba1b32dac945dde0d04;hb=e497bb1b59c80256eac3c3e2f0608b1400098e0a;hp=a91e4a60d7e88806b11881ca69fa962b9ca3f49d;hpb=b585d00928892398dfbfc315ed78b8032fa14708;p=mono.git diff --git a/mcs/class/System.Configuration/System.Configuration/PropertyInformation.cs b/mcs/class/System.Configuration/System.Configuration/PropertyInformation.cs index a91e4a60d7e..9d5662712ad 100644 --- a/mcs/class/System.Configuration/System.Configuration/PropertyInformation.cs +++ b/mcs/class/System.Configuration/System.Configuration/PropertyInformation.cs @@ -39,9 +39,8 @@ namespace System.Configuration string source; object val; PropertyValueOrigin origin; - ConfigurationElement owner; - - ConfigurationProperty property; + readonly ConfigurationElement owner; + readonly ConfigurationProperty property; internal PropertyInformation (ConfigurationElement owner, ConfigurationProperty property) { @@ -108,21 +107,13 @@ namespace System.Configuration 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; }