+2007-05-14 Igor Zelmanovich <igorz@mainsoft.com>
+
+ * ConfigurationElement.cs: when attribute value cannot be parsed,
+ ConfigurationErrorException is thrown.
+
2007-05-09 Igor Zelmanovich <igorz@mainsoft.com>
* ConfigurationManager.cs:
else if (reader.LocalName == "lockElements") {
LockElements.SetFromList (reader.Value);
}
- else if (reader.LocalName == "lockItem") {\r
+ else if (reader.LocalName == "lockItem") {
LockItem = (reader.Value.ToLowerInvariant () == "true");
}
else if (reader.LocalName == "xmlns") {
if (readProps.ContainsKey (prop))
throw new ConfigurationException ("The attribute '" + prop.Name + "' may only appear once in this element.");
- prop.SetStringValue (reader.Value);
+ try {
+ prop.SetStringValue (reader.Value);
+ }
+ catch (Exception ex) {
+ string msg = String.Format ("The value of the property '{0}' cannot be parsed.", prop.Name);
+ throw new ConfigurationErrorsException (msg, reader);
+ }
readProps [prop] = prop.Name;
}