[Mono-bugs] [Bug 57460][Nor] Changed - System.ComponentModel BooleanConverter string conversion

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 23 Apr 2004 04:56:07 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by davide@devage.com.

http://bugzilla.ximian.com/show_bug.cgi?id=57460

--- shadow/57460	2004-04-22 19:25:13.000000000 -0400
+++ shadow/57460.tmp.23610	2004-04-23 04:56:07.000000000 -0400
@@ -58,6 +58,24 @@
 
 
 Davide Icardi
 
 ------- Additional Comments From gonzalo@ximian.com  2004-04-22 19:25 -------
 It would be nice to get a test case showing a wrong behaviour
+
+------- Additional Comments From davide@devage.com  2004-04-23 04:56 -------
+For example this code works with the Microsoft version and fail with
+MONO version:
+System.ComponentModel.BooleanConverter boolConv = new
+System.ComponentModel.BooleanConverter();
+System.Globalization.CultureInfo culture = null;
+System.ComponentModel.ITypeDescriptorContext context = null;
+bool b = (bool)boolConv.ConvertFrom(context, culture, "false");
+b = (bool)boolConv.ConvertFrom(context, culture, "false ");
+b = (bool)boolConv.ConvertFrom(context, culture, " true");
+
+In the MSDN seems that only context parameter can be null (and maybe I
+only call the TypeConvert with the wrong parameter), but I suggest to
+not use ToLower but simply use bool.Parse. In this way culture
+parameter is not necessary. I also add a Trim on the string.
+
+Thanks