2007-04-17 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Tue, 17 Apr 2007 01:54:45 +0000 (01:54 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Tue, 17 Apr 2007 01:54:45 +0000 (01:54 -0000)
* ConfigurationSectionCollection.cs : GetEnumerator() should return
  IEnumerator for the items, not keys.
* ConfigurationProperty.cs : more helpful type mismatch message.

svn path=/trunk/mcs/; revision=75801

mcs/class/System.Configuration/System.Configuration/ChangeLog
mcs/class/System.Configuration/System.Configuration/ConfigurationProperty.cs
mcs/class/System.Configuration/System.Configuration/ConfigurationSectionCollection.cs

index 2cc83b57cf441bd49887e624bd9582ac4adcda6b..ccc6fd9c2ff6bec78b1570623bfad32e6815ebbc 100644 (file)
@@ -1,3 +1,9 @@
+2007-04-17  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * ConfigurationSectionCollection.cs : GetEnumerator() should return
+         IEnumerator for the items, not keys.
+       * ConfigurationProperty.cs : more helpful type mismatch message.
+
 2007-04-16  Marek Habersack  <mhabersack@novell.com>
 
        * SectionGroupInfo.cs: another (and final, hopefully) fix for bug
index a4af70e6fcaa4837899f48068ba5af2f7b40b26e..93a2c5d1123ae447717e6a84569ddaf97a667112 100644 (file)
@@ -94,8 +94,8 @@ namespace System.Configuration
                                else
                                        if (!type.IsAssignableFrom (default_value.GetType ())) {
                                                if (!this.converter.CanConvertFrom (default_value.GetType ()))
-                                                       throw new ConfigurationErrorsException (String.Format ("The default value for property '{0}' has a different type than the one of the property itself",
-                                                                                                          name));
+                                                       throw new ConfigurationErrorsException (String.Format ("The default value for property '{0}' has a different type than the one of the property itself: expected {1} but was {2}",
+                                                                                                          name, type, default_value.GetType ()));
 
                                                default_value = this.converter.ConvertFrom (default_value);
                                        }
index 4ee54c7240fb51f0d211588bc9fcbee1de8a9dde..34848b119d9aef383322043bf19ce1ab8d5e7105 100644 (file)
@@ -109,7 +109,8 @@ namespace System.Configuration
                
                public override IEnumerator GetEnumerator()
                {
-                       return group.Sections.AllKeys.GetEnumerator ();
+                       foreach (string key in group.Sections.AllKeys)
+                               yield return this [key];
                }
                
                public string GetKey (int index)