Files
mono/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
T
Miguel de Icaza ee4c94e9ba More Updates from Guarav
svn path=/trunk/mcs/; revision=1259
2001-11-05 06:11:37 +00:00

87 lines
1.8 KiB
C#
Executable File

/**
* Namespace: System.Web.UI.WebControls
* Class: BaseCompareValidator
*
* Author: Gaurav Vaish
* Contact: <[email protected]>
* Status: 100%
*
* (C) Gaurav Vaish (2001)
*/
using System;
using System.Collections;
using System.Globalization;
using System.Web;
using System.Web.UI;
namespace System.Web.UI.WebControls
{
public abstract class BaseCompareValidator: BaseValidator
{
protected BaseCompareValidator(): base()
{
//TODO: Init work
}
/*[
WebSysDescriptionAttribute("RangeValidator_Type"),
WebCategoryAttribute("Behaviour"),
DefaultValueAttribute(System.Web.UI.WebControls.ValidationDataType)
]*/
public static bool CanConvert(string text, ValidationDataType type)
{
//text = null;
return false;
}
public ValidationDataType Type
{
get
{
object o = ViewState["Type"];
if(o!=null)
return (ValidationDataType)o;
return ValidationDataType.String;
}
set
{
if(!System.Enum.IsDefined(typeof(ValidationDataType), value))
throw new ArgumentException();
ViewState["Type"] = value;
// Else the function itself throws the exception
}
}
protected static int CutoffYear
{
get
{
return DateTimeFormatInfo.CurrentInfo.Calendar.TwoDigitYearMax;
}
}
protected static int GetFullYear(int shortYear)
{
DateTime dt = DateTime.Today;
int year = dt.Year;
return 0; //TODO: Get the values. This is just to ensure that the code compiles
}
protected override void AddAttributesToRender(HtmlTextWriter writer)
{
/*
ValidationDataType vdt;
NumberFormatInfo nfi;
DateTime dt;
*/
base.AddAttributesToRender(writer);
if(base.RenderUplevel)
{
// TODO: The Lost World
}
}
}
}