|
ValidatorEntryComparerFull pathMadWidgets.Validation.ValidatorEntryComparer
Declarationpublic abstract class ValidatorEntryComparer : ValidatorEntryClientServer
HierarchyClick on the selected class to view any properties or methods that may be accessible through an instance of this class through inheritance.ValidatorEntryComparer
OverviewThe ValidatorEntryComparer class is the base class for all validation entries that are used to compare two related objects (e.g. form fields). The types of comparison available are found in the MadWidgets.Validation.ComparisonMethod enumeration. The following table lists the constants found in this enumeration and their meaning:
* NOTE: In version 1.2 and below, the ComparisonMethod enumeration is called CompareMethod. ConstructorsPublic propertiesPublic methodsProtected methods
ConstructorsValidatorEntryComparerpublic ValidatorEntryComparer(object o1, object o2, ComparisonMethod cm, string sMessage, string sHighlightElement)
Creates a ValidatorEntryComparer based on the two input objects o1 and o2 and a compare method together with a message and a client-side highlight element signature. Public propertiesFirstObjectpublic override string FirstObject {get;}
Overrides the property of the same name from the ValidatorEntry class and returns the object passed as o1 in the constructor. Public methodsContainsObjectpublic override bool ContainsObject(object o)
Overrides the method of the same name from the ValidatorEntry Protected methodsClientSideOperatorprotected string ClientSideOperator()
Returns the Javascript eqivalent operator of the compare mode passed in the constructor. ClientSideValueConversionCodeprotected virtual string ClientSideValueConversionCode(string sValueId, int iObjectNr)
Designed to be overridden by ValidatorEntryComparer subclasses, this method should return Javascript code that converts the value represented by the client-side variable name in sValueId into a form that can be validated by the client-side validator code. For example, if the comparer was an integer comparer and the variable represented by sValueId was a string value representing an integer, then you might return "parseInt(" + sValueId + ")" from this method. The parameter iObjectNr can be either 1 or 2 indicating which of the two validated objects supplied in the constructor is being referenced by the variable name found in sValueId. Some ValidatorEntryComparer subclasses manipulate the value of either the first or the second object before returning it. GetObjectValueprotected abstract IComparable GetObjectValue(object o, int iObjectNr)
This method must be overridden by subclasses. The method must return an IComparable that is the equivalent value of the value of the object passed to it. You can obtain the value of this object by calling GetValidationValue(o) of the ValidatorEntry class. GetValidationValue(o) always returns a string, so this method must convert the string to a type that is compatible with the basic type being validated by the comparer. The parameter iObjectNr can be either 1 or 2 indicating which of the two validated objects supplied in the constructor is being referenced by the variable name found in sValueId. Some ValidatorEntryComparer subclasses manipulate the value of either the first or the second object before returning it. © 2002 - 2009 Copyright, Disclaimer and Privacy Statement |
||||||||||||||||||||