[Mono-bugs] [Bug 374335] New: PropertyGrid: IconConverter / CursorConverter should display "(none)" for null
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Thu Mar 27 07:06:24 EDT 2008
https://bugzilla.novell.com/show_bug.cgi?id=374335
Summary: PropertyGrid: IconConverter / CursorConverter should
display "(none)" for null
Product: Mono: Class Libraries
Version: 1.9.0
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Windows.Forms
AssignedTo: contact at i-nz.net
ReportedBy: andyhume32 at yahoo.co.uk
QAContact: mono-bugs at lists.ximian.com
Found By: ---
With some local C.WL logging in PropertyGrid/System.ComponentModel, whenever an
Icon or Cursor property is drawn I see the following:
"GridEntry.ConvertToString: Property value of (null) is not convertible to
string"
This has no great user-visible impact in PropertyGrid (display <> vs <(none)>),
but there'll be some exception throw cost, and maybe other components expect
that behaviour, etc.
Thus the two converters should be changed to handle ConvertToString(null) i.e.
[[
Index: IconConverter.cs
===================================================================
--- IconConverter.cs (revision 97252)
+++ IconConverter.cs (working copy)
@@ -78,6 +78,8 @@
{
if ((val is Icon) && (destType == typeof (string)))
return val.ToString ();
+ else if ((val == null) && (destType == typeof
(string)))
+ return "(none)";
else if (CanConvertTo (null, destType)) {
//came here means destType is byte array ;
MemoryStream ms = new MemoryStream ();
]]
and
[[
Index: CursorConverter.cs
===================================================================
--- CursorConverter.cs (revision 97252)
+++ CursorConverter.cs (working copy)
@@ -75,6 +75,8 @@
if (destinationType == null)
throw new ArgumentNullException
("destinationType");
+ if (value == null && destinationType == typeof(String))
+ return "(none)";
if ( !(value is Cursor))
throw new ArgumentException("object must be of
class Cursor", "value");
]]
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the mono-bugs
mailing list