浏览代码

2005-12-01 Gonzalo Paniagua Javier <[email protected]>

	* TemplateControlCompiler.cs: treat LightGrey as a synonym of LightGray.
	Fixes bug #76677.


svn path=/trunk/mcs/; revision=53803
Gonzalo Paniagua Javier 20 年之前
父节点
当前提交
9eea35e3ab

+ 5 - 0
mcs/class/System.Web/System.Web.Compilation/ChangeLog

@@ -1,3 +1,8 @@
+2005-12-01 Gonzalo Paniagua Javier <[email protected]>
+
+	* TemplateControlCompiler.cs: treat LightGrey as a synonym of LightGray.
+	Fixes bug #76677.
+
 2005-11-30 Gonzalo Paniagua Javier <[email protected]>
 
 	* TemplateControlCompiler.cs: handle data bound attributes for html

+ 8 - 1
mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs

@@ -1130,8 +1130,15 @@ namespace System.Web.Compilation
 						c = Color.FromArgb (argb [0], argb [1], argb [2], argb [3]);
 					}
 				} catch (Exception e){
-					throw new ParseException (currentLocation,
+					// Hack: "LightGrey" is accepted, but only for ASP.NET, as the
+					// TypeConverter for Color fails to ConvertFromString.
+					// Hence this hack...
+					if (InvariantCompareNoCase ("LightGrey", str)) {
+						c = Color.LightGray;
+					} else {
+						throw new ParseException (currentLocation,
 							"Color " + str + " is not a valid color.", e);
+					}
 				}
 
 				if (c.IsKnownColor){