Author: igorz
Date: 2006-11-02 10:38:28 -0500 (Thu, 02 Nov 2006)
New Revision: 67274
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseCompareValidatorTest.cs
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
Log:
2006-11-02 Igor Zelmanovich <[EMAIL PROTECTED]>
* BaseCompareValidator.cs: fixed: CultureInvariantValues, Type
properties.
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
===================================================================
---
trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
2006-11-02 15:03:31 UTC (rev 67273)
+++
trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
2006-11-02 15:38:28 UTC (rev 67274)
@@ -39,8 +39,6 @@
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level =
AspNetHostingPermissionLevel.Minimal)]
public abstract class BaseCompareValidator : BaseValidator {
- ValidationDataType type;
-
#if NET_2_0
protected
#else
@@ -48,13 +46,12 @@
#endif
BaseCompareValidator ()
{
- type = ValidationDataType.String;
}
protected override void AddAttributesToRender (HtmlTextWriter w)
{
if (RenderUplevel) {
- w.AddAttribute ("datatype", type.ToString());
+ w.AddAttribute ("datatype", Type.ToString());
}
base.AddAttributesToRender (w);
@@ -211,16 +208,11 @@
}
#if NET_2_0
- [MonoTODO]
[DefaultValue (false)]
[Themeable (false)]
public bool CultureInvariantValues {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
+ get { return ViewState.GetBool
("CultureInvariantValues", false); }
+ set { ViewState ["CultureInvariantValues"] = value; }
}
#endif
@@ -237,12 +229,8 @@
[WebSysDescription("")]
[WebCategory("Behavior")]
public ValidationDataType Type {
- get {
- return type;
- }
- set {
- type = value;
- }
+ get { return ViewState ["Type"] == null ?
ValidationDataType.String : (ValidationDataType) ViewState ["Type"]; }
+ set { ViewState ["Type"] = value; }
}
#if NET_2_0
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
2006-11-02 15:03:31 UTC (rev 67273)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
2006-11-02 15:38:28 UTC (rev 67274)
@@ -1,3 +1,7 @@
+2006-11-02 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+ * BaseCompareValidator.cs: fixed: CultureInvariantValues, Type
properties.
+
2006-11-01 Igor Zelmanovich <[EMAIL PROTECTED]>
* Menu.cs: fixed: RenderEndTag.
Modified:
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseCompareValidatorTest.cs
===================================================================
---
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseCompareValidatorTest.cs
2006-11-02 15:03:31 UTC (rev 67273)
+++
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseCompareValidatorTest.cs
2006-11-02 15:38:28 UTC (rev 67274)
@@ -111,20 +111,23 @@
{
[Test]
- [Category("NotWorking")]
public void DefaultProperties ()
{
BaseCompareValidatorPoker p = new
BaseCompareValidatorPoker ();
+
+ Assert.AreEqual (ValidationDataType.String, p.Type,
"CultureInvariantValues");
#if NET_2_0
Assert.AreEqual (false, p.CultureInvariantValues,
"CultureInvariantValues");
#endif
}
[Test]
- [Category ("NotWorking")]
public void AssignProperties ()
{
BaseCompareValidatorPoker p = new
BaseCompareValidatorPoker ();
+
+ p.Type = ValidationDataType.Double;
+ Assert.AreEqual (ValidationDataType.Double, p.Type,
"CultureInvariantValues");
#if NET_2_0
p.CultureInvariantValues = true;
Assert.AreEqual (true, p.CultureInvariantValues,
"CultureInvariantValues");
@@ -136,8 +139,18 @@
{
BaseCompareValidatorPoker p = new
BaseCompareValidatorPoker ();
- p.Type = ValidationDataType.String;
- Assert.AreEqual (p.Type, ValidationDataType.String,
"A1");
+ p.Type = ValidationDataType.Double;
+#if NET_2_0
+ p.CultureInvariantValues = true;
+#endif
+
+ BaseCompareValidatorPoker copy = new
BaseCompareValidatorPoker ();
+ copy.LoadState (p.SaveState ());
+
+ Assert.AreEqual (ValidationDataType.Double, copy.Type,
"A1");
+#if NET_2_0
+ Assert.AreEqual (true, copy.CultureInvariantValues,
"A1");
+#endif
}
[Test]
@@ -479,7 +492,6 @@
#if NET_2_0
[Test]
- [Category ("NotWorking")]
public void CultureInvariantValues_1 ()
{
Thread.CurrentThread.CurrentCulture = new CultureInfo
("en-US", false);
@@ -516,7 +528,6 @@
}
[Test]
- [Category ("NotWorking")]
public void CultureInvariantValues_2 ()
{
Modified: trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
2006-11-02 15:03:31 UTC (rev 67273)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
2006-11-02 15:38:28 UTC (rev 67274)
@@ -1,3 +1,7 @@
+2006-11-02 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+ * BaseCompareValidatorTest.cs: removed NotWorking attributes, fixed
tests
+
2006-11-01 Igor Zelmanovich <[EMAIL PROTECTED]>
* MenuTest.cs: removed NotWorking attributes
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches