Author: miguel
Date: 2005-09-01 10:55:44 -0400 (Thu, 01 Sep 2005)
New Revision: 49274
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
trunk/mcs/class/System.Web/System.Web.UI.WebControls/FontInfo.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls/HotSpot.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls/ImageButton.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls/Menu.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls/MenuItemStyle.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls/WebControl.cs
Log:
2005-09-01 Miguel de Icaza <[EMAIL PROTECTED]>
* Various places: make sure that the DefaultValue matches the
type. Thanks to Michael for pointing this out.
In future audits, you might want to use the following awk command:
awk '/DefaultValue/ { v=$0; looking = 1; } /public/ && looking &&
!/string/ && !/ int / && !/ bool / { print FILENAME; print v;
print $0; looking = 0; } /public/ && looking { looking = 0; } '
*.cs
The above skips bools, strings and ints as those were fine as we
set them. The bug was on the other ones.
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs
2005-09-01 14:53:42 UTC (rev 49273)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs
2005-09-01 14:55:44 UTC (rev 49274)
@@ -171,7 +171,7 @@
}
}
- [DefaultValue("Color [Red]")]
+ [DefaultValue(typeof (Color), "Red")]
public override Color ForeColor {
get {
return forecolor;
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
2005-09-01 14:53:42 UTC (rev 49273)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
2005-09-01 14:55:44 UTC (rev 49274)
@@ -1,3 +1,18 @@
+2005-09-01 Miguel de Icaza <[EMAIL PROTECTED]>
+
+ * Various places: make sure that the DefaultValue matches the
+ type. Thanks to Michael for pointing this out.
+
+ In future audits, you might want to use the following awk command:
+
+ awk '/DefaultValue/ { v=$0; looking = 1; } /public/ && looking &&
+ !/string/ && !/ int / && !/ bool / { print FILENAME; print v;
+ print $0; looking = 0; } /public/ && looking { looking = 0; } '
+ *.cs
+
+ The above skips bools, strings and ints as those were fine as we
+ set them. The bug was on the other ones.
+
2005-08-31 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* Repeater.cs: fix the build.
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/FontInfo.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/FontInfo.cs
2005-09-01 14:53:42 UTC (rev 49273)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/FontInfo.cs
2005-09-01 14:55:44 UTC (rev 49274)
@@ -201,7 +201,7 @@
}
[Bindable(true)]
- [DefaultValue("")]
+ [DefaultValue(typeof (FontUnit), "")]
[NotifyParentProperty(true)]
public FontUnit Size
{
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/HotSpot.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/HotSpot.cs
2005-09-01 14:53:42 UTC (rev 49273)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/HotSpot.cs
2005-09-01 14:55:44 UTC (rev 49274)
@@ -110,7 +110,7 @@
}
}
- [DefaultValueAttribute (0)]
+ [DefaultValueAttribute ((short)0)]
[WebCategoryAttribute ("Accessibility")]
public virtual short TabIndex {
get {
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ImageButton.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ImageButton.cs
2005-09-01 14:53:42 UTC (rev 49273)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ImageButton.cs
2005-09-01 14:55:44 UTC (rev 49274)
@@ -107,7 +107,7 @@
#if NET_2_0
[EditorBrowsable (EditorBrowsableState.Always)]
[Browsable (true)]
- [DefaultValue ("")]
+ [DefaultValue (true)]
[Bindable (true)]
[MonoTODO]
public virtual new bool Enabled
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/Menu.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/Menu.cs
2005-09-01 14:53:42 UTC (rev 49273)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/Menu.cs
2005-09-01 14:55:44 UTC (rev 49274)
@@ -237,7 +237,7 @@
}
}
- [DefaultValue ("16px")]
+ [DefaultValue (typeof (Unit), "16px")]
[ThemeableAttribute (true)]
public Unit StaticSubMenuIndent {
get {
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/MenuItemStyle.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/MenuItemStyle.cs
2005-09-01 14:53:42 UTC (rev 49273)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/MenuItemStyle.cs
2005-09-01 14:55:44 UTC (rev 49274)
@@ -47,7 +47,7 @@
return ViewState [v] != null;
}
- [DefaultValue (0)]
+ [DefaultValue (typeof (Unit), "")]
[NotifyParentProperty (true)]
public Unit HorizontalPadding {
get {
@@ -60,7 +60,7 @@
}
}
- [DefaultValue (0)]
+ [DefaultValue (typeof (Unit), "")]
[NotifyParentProperty (true)]
public Unit VerticalPadding {
get {
@@ -73,7 +73,7 @@
}
}
- [DefaultValue (0)]
+ [DefaultValue (typeof (Unit), "")]
[NotifyParentProperty (true)]
public Unit ItemSpacing {
get {
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs
2005-09-01 14:53:42 UTC (rev 49273)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs
2005-09-01 14:55:44 UTC (rev 49274)
@@ -97,7 +97,7 @@
#region Public Instance Properties
[Bindable(true)]
- [DefaultValue("Color [Empty]")]
+ [DefaultValue(typeof (Color), "")]
[NotifyParentProperty(true)]
[TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))]
public Color BackColor
@@ -120,7 +120,7 @@
}
[Bindable(true)]
- [DefaultValue("Color [Empty]")]
+ [DefaultValue(typeof (Color), "")]
[NotifyParentProperty(true)]
[TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))]
public Color BorderColor
@@ -165,7 +165,7 @@
}
[Bindable(true)]
- [DefaultValue("")]
+ [DefaultValue(typeof (Unit), "")]
[NotifyParentProperty(true)]
public Unit BorderWidth
{
@@ -227,7 +227,7 @@
}
[Bindable(true)]
- [DefaultValue("Color [Empty]")]
+ [DefaultValue(typeof (Color), "")]
[NotifyParentProperty(true)]
[TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))]
public Color ForeColor
@@ -250,7 +250,7 @@
}
[Bindable(true)]
- [DefaultValue("")]
+ [DefaultValue(typeof (Unit), "")]
[NotifyParentProperty(true)]
public Unit Height
{
@@ -277,7 +277,7 @@
}
[Bindable(true)]
- [DefaultValue("")]
+ [DefaultValue(typeof (Unit), "")]
[NotifyParentProperty(true)]
public Unit Width
{
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs
2005-09-01 14:53:42 UTC (rev 49273)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs
2005-09-01 14:55:44 UTC (rev 49274)
@@ -79,7 +79,7 @@
}
}
- [DefaultValue("Color [Red]")]
+ [DefaultValue(typeof (Color), "Red")]
public override System.Drawing.Color ForeColor {
get {
return base.ForeColor;
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/WebControl.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/WebControl.cs
2005-09-01 14:53:42 UTC (rev 49273)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/WebControl.cs
2005-09-01 14:55:44 UTC (rev 49274)
@@ -95,7 +95,7 @@
#if ONLY_1_1
[Bindable(true)]
#endif
- [DefaultValue("Color [Empty]")]
+ [DefaultValue(typeof (Color), "")]
[TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))]
public virtual Color BackColor {
get {
@@ -112,7 +112,7 @@
#if ONLY_1_1
[Bindable(true)]
#endif
- [DefaultValue("Color [Empty]")]
+ [DefaultValue(typeof (Color), "")]
[TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))]
public virtual Color BorderColor {
get {
@@ -149,7 +149,7 @@
#if ONLY_1_1
[Bindable(true)]
#endif
- [DefaultValue("")]
+ [DefaultValue(typeof (Unit), "")]
public virtual Unit BorderWidth {
get {
if (style == null)
@@ -249,7 +249,7 @@
#if ONLY_1_1
[Bindable(true)]
#endif
- [DefaultValue("Color [Empty]")]
+ [DefaultValue(typeof (Color), "")]
[TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))]
public virtual Color ForeColor {
get {
@@ -278,7 +278,7 @@
#if ONLY_1_1
[Bindable(true)]
#endif
- [DefaultValue("")]
+ [DefaultValue(typeof (Unit), "")]
public virtual Unit Height {
get {
if (style == null)
@@ -313,7 +313,7 @@
}
}
- [DefaultValue(0)]
+ [DefaultValue((short)0)]
public virtual short TabIndex {
get {
return ViewState.GetShort ("TabIndex", 0);
@@ -342,7 +342,7 @@
#if ONLY_1_1
[Bindable(true)]
#endif
- [DefaultValue("")]
+ [DefaultValue(typeof (Unit), "")]
public virtual Unit Width {
get {
if (style == null)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches