Sfoglia il codice sorgente

2009-10-12 Marek Habersack <[email protected]>

	* ObjectStateFormatter.cs: if a type is associated with a type
	converter, do not check if the converter can convert FROM the type
	in question, as this is implied. Fixes bug #545979

svn path=/trunk/mcs/; revision=143967
Marek Habersack 16 anni fa
parent
commit
3a170ffe7d

+ 6 - 0
mcs/class/System.Web/System.Web.UI/ChangeLog

@@ -1,3 +1,9 @@
+2009-10-12  Marek Habersack  <[email protected]>
+
+	* ObjectStateFormatter.cs: if a type is associated with a type
+	converter, do not check if the converter can convert FROM the type
+	in question, as this is implied. Fixes bug #545979
+
 2009-10-09  Marek Habersack  <[email protected]>
 
 	* Control.cs: implemented the LoadViewStateByID property as well

+ 2 - 4
mcs/class/System.Web/System.Web.UI/ObjectStateFormatter.cs

@@ -433,11 +433,9 @@ namespace System.Web.UI {
 										t,
 										converter != null ? converter.CanConvertFrom (t) : false));
 #endif
-						if (converter == null ||
-						    !converter.CanConvertTo (typeof (string)) ||
-						    !converter.CanConvertFrom (t)) {
+						if (converter == null || !converter.CanConvertTo (typeof (string)))
 							fmt = binaryObjectFormatter;
-						} else {
+						else {
 							typeConverterFormatter.Converter = converter;
 							fmt = typeConverterFormatter;
 						}