June 2002
Intermediate to advanced
816 pages
28h 12m
English
BaseCompareValidator
This abstract class provides basic functionality for the CompareValidator and RangeValidator classes, which perform
validation through comparisons. The shared (static) GetFullYear()
method converts a two-digit year (like “98”) to a four-digit representation (“1998”),
while CutoffYear
sets the maximum four-digit year value that it will allow to be represented in two
digits. The shared CanConvert() method
determines whether a string can be converted to a given ValidationDataType, while the Type property sets
the ValidationDataType that the current
instance of the control is validating text against.
Public MustInherit Class BaseCompareValidator : Inherits BaseValidator ' Protected Constructors Protected Sub New() ' Protected Shared Properties Shared Protected Property CutoffYear As Integer ' Public Instance Properties Public Property Type As ValidationDataType ' Public Shared Methods Public Shared Function CanConvert(ByVal text As String, ByVal type As ValidationDataType) As Boolean ' Protected Shared Methods Shared Protected Function Compare(ByVal leftText As String, ByVal rightText As String, ByVal op As ValidationCompareOperator, ByVal type As ValidationDataType) As Boolean Shared Protected Function Convert(ByVal text As String, ByVal type As ValidationDataType, ByRef value As Object) As Boolean Shared Protected Function GetDateElementOrder() As String Shared Protected Function GetFullYear( ByVal shortYear As Integer) As Integer ' Protected Instance ...
Read now
Unlock full access