[Mono-devel-list] Bugs in Enum conversion using TypeDescriptor and EnumConverter

Jörg Rosenkranz joergr at voelcker.com
Wed Sep 10 11:23:25 EDT 2003


I have found two bugs in System.ComponentModel:

1) TypeDescriptor.GetConverter does not work for enumeration 
   types because EnumConverter does not have a default constructor.

   Fix: I have changed the special handling for enumeration types.

2) EnumConverter.ConvertFrom fails with InvalidCastException because 
   the enumeration value is casted to long.

   Fix: Removed the special handling for multiple values. This is done
   in Enum.Parse already.

I have filed a bug for these two:
http://bugzilla.ximian.com/show_bug.cgi?id=48351

Could someone please review the attached patch?

Thanks,
Jörg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: EnumConversion.diff
Type: application/octet-stream
Size: 3292 bytes
Desc: EnumConversion.diff
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030910/598de265/attachment.obj 


More information about the Mono-devel-list mailing list