Kaynağa Gözat

2007-11-21 Atsushi Enomoto <[email protected]>

	* CustomizableFileSettingsProvider.cs : when a property is found
	  only in the config file and not in the corresponding config type,
	  do not raise NRE but just add it as a simple property value.
	  Fixed bug #343459.


svn path=/trunk/mcs/; revision=90108
Atsushi Eno 18 yıl önce
ebeveyn
işleme
ee6b478c4e

+ 7 - 0
mcs/class/System/System.Configuration/ChangeLog

@@ -1,3 +1,10 @@
+2007-11-21  Atsushi Enomoto  <[email protected]>
+
+	* CustomizableFileSettingsProvider.cs : when a property is found
+	  only in the config file and not in the corresponding config type,
+	  do not raise NRE but just add it as a simple property value.
+	  Fixed bug #343459.
+
 2007-11-13  Atsushi Enomoto  <[email protected]>
 
 	* ConfigXmlDocument.cs : corcompare cleanup.

+ 5 - 0
mcs/class/System/System.Configuration/CustomizableFileSettingsProvider.cs

@@ -648,6 +648,11 @@ namespace System.Configuration
 		private void LoadPropertyValue (SettingsPropertyCollection collection, SettingElement element, bool allowOverwrite)
 		{
 			SettingsProperty prop = collection [element.Name];
+			if (prop == null) { // see bug #343459
+				prop = new SettingsProperty (element.Name);
+				collection.Add (prop);
+			}
+
 			SettingsPropertyValue value = new SettingsPropertyValue (prop);
 			value.IsDirty = false;
 			value.SerializedValue = element.Value.ValueXml != null ? element.Value.ValueXml.InnerText : prop.DefaultValue;