Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLluis Sanchez <lluis@novell.com>2004-05-05 21:05:53 +0400
committerLluis Sanchez <lluis@novell.com>2004-05-05 21:05:53 +0400
commit158becb0c37c4c7b1b975d8e2b30d2767f53247f (patch)
tree432390530ddcef086b95c566c3cc7844f2538118 /mcs/class/System/System.ComponentModel
parent881f005dfd1cfbe80a32e3ab44e34baac56e0163 (diff)
* BooleanConverter.cs: Improved ConverFrom method.
svn path=/trunk/mcs/; revision=26771
Diffstat (limited to 'mcs/class/System/System.ComponentModel')
-rw-r--r--mcs/class/System/System.ComponentModel/BooleanConverter.cs15
-rw-r--r--mcs/class/System/System.ComponentModel/ChangeLog4
2 files changed, 8 insertions, 11 deletions
diff --git a/mcs/class/System/System.ComponentModel/BooleanConverter.cs b/mcs/class/System/System.ComponentModel/BooleanConverter.cs
index 9f637774b33..1f53bcaa13f 100644
--- a/mcs/class/System/System.ComponentModel/BooleanConverter.cs
+++ b/mcs/class/System/System.ComponentModel/BooleanConverter.cs
@@ -29,17 +29,10 @@ namespace System.ComponentModel
public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
{
- if (value.GetType() == typeof (string)) {
- string Test = ((String) value).ToLower (culture);
- if (Test.Equals ("true"))
- return true;
- else if (Test.Equals ("false"))
- return false;
- else
- throw new FormatException ("No valid boolean value");
- }
-
- return base.ConvertFrom (context, culture, value);
+ if (value is string)
+ return bool.Parse ((string) value);
+ else
+ return base.ConvertFrom (context, culture, value);
}
public override StandardValuesCollection GetStandardValues (ITypeDescriptorContext context)
diff --git a/mcs/class/System/System.ComponentModel/ChangeLog b/mcs/class/System/System.ComponentModel/ChangeLog
index 6ba49fc8e90..155415c045a 100644
--- a/mcs/class/System/System.ComponentModel/ChangeLog
+++ b/mcs/class/System/System.ComponentModel/ChangeLog
@@ -1,3 +1,7 @@
+2004-05-05 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * BooleanConverter.cs: Improved ConverFrom method.
+
2004-04-28 Lluis Sanchez Gual <lluis@ximian.com>
* TypeDescriptor.cs: Do not return attributes that have the same TypeID.