BaseCompareValidator.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /**
  2. * Namespace: System.Web.UI.WebControls
  3. * Class: BaseCompareValidator
  4. *
  5. * Author: Gaurav Vaish
  6. * Maintainer: [email protected]
  7. * Contact: <[email protected]>
  8. * Status: 30%
  9. *
  10. * (C) Gaurav Vaish (2001)
  11. */
  12. using System;
  13. using System.Collections;
  14. using System.Globalization;
  15. using System.Web;
  16. using System.Web.UI;
  17. namespace System.Web.UI.WebControls
  18. {
  19. public abstract class BaseCompareValidator: BaseValidator
  20. {
  21. protected BaseCompareValidator(): base()
  22. {
  23. super();
  24. }
  25. /*[
  26. WebSysDescriptionAttribute("RangeValidator_Type"),
  27. WebCategoryAttribute("Behaviour"),
  28. DefaultValueAttribute(System.Web.UI.WebControls.ValidationDataType)
  29. ]*/
  30. public static bool CanConvert(string text, ValidationDataType type)
  31. {
  32. //TODO: Implement me
  33. return false;
  34. }
  35. public ValidationDataType Type
  36. {
  37. get
  38. {
  39. object o = ViewState["Type"];
  40. if(o!=null)
  41. return (ValidationDataType)o;
  42. return ValidationDataType.String;
  43. }
  44. set
  45. {
  46. if(!System.Enum.IsDefined(typeof(ValidationDataType), value))
  47. throw new ArgumentException();
  48. ViewState["Type"] = value;
  49. }
  50. }
  51. protected static int CutoffYear
  52. {
  53. get
  54. {
  55. return DateTimeFormatInfo.CurrentInfo.Calendar.TwoDigitYearMax;
  56. }
  57. }
  58. protected static int GetFullYear(int shortYear)
  59. {
  60. //TODO: Implement me
  61. }
  62. protected override void AddAttributesToRender(HtmlTextWriter writer)
  63. {
  64. /*
  65. ValidationDataType vdt;
  66. NumberFormatInfo nfi;
  67. DateTime dt;
  68. */
  69. base.AddAttributesToRender(writer);
  70. if(base.RenderUplevel)
  71. {
  72. // TODO: The Lost World
  73. }
  74. }
  75. }
  76. }