[Mono-bugs] [Bug 77500][Nor] New - [PATCH] XmlCustomFormatter / XmlSerializationWriter fixes

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Feb 8 03:42:46 EST 2006


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 gert.driesen at pandora.be.

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

--- shadow/77500	2006-02-08 03:42:46.000000000 -0500
+++ shadow/77500.tmp.8349	2006-02-08 03:42:46.000000000 -0500
@@ -0,0 +1,51 @@
+Bug#: 77500
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.XML
+AssignedTo: atsushi at ximian.com                            
+ReportedBy: gert.driesen at pandora.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [PATCH] XmlCustomFormatter / XmlSerializationWriter fixes
+
+The attached patch implements the following 2.0 methods in 
+System.Xml.Serialization.XmlSerializationWriter:
+
+- CreateInvalidEnumValueException (object, string)
+- FromEnum (long, string[], long[], string)
+
+The following issues are fixed in the FromEnum and ToEnum methods of 
+XmlCustomFormatter, which are solely used in XmlSerializationWriter and 
+XmlSerializationWriter:
+
+- Added FromEnum overload that takes name of enum for which string value 
+must be created. 
+- Modified FromEnum to behave more like MSFT's implementation:
+   * treat value as bit field.
+   * no longer return empty string if the value matches an id for
+   which there's no corresponding name.
+   * if one of the ids has value 0 and there's a match for the enum value
+   (with a zero length XML name) or the enum value is 0, then return the 
+   corresponding XML name for the id with value 0.
+   * in 2.0 profile, throw InvalidOperationException if no match is found
+   for (part of) the enum value.
+- Modified ToEnum to match the MSFT implementation (as described in .NET 
+2.0 SDK):
+   * Expect hashtable containing enum names as key, and corresponding
+   integral numbers as value.
+   * Do not report exception for whitespace-only value.
+   * Support space (MS docs are not clear about this) delimited list 
+   of names.
+   * typeName is only used to construct exception message (not to create  
+   an instance of an enum).
+
+I'll attach two patches: one for the fixes/changes, and one for the unit 
+tests covering these changes.


More information about the mono-bugs mailing list