HouseOver.THARM.Search.ComparableCheck Class Reference

A class designed to check wether a value is between a minimum and maximum value, or equal to either. More...

Inheritance diagram for HouseOver.THARM.Search.ComparableCheck:

Inheritance graph
[legend]
Collaboration diagram for HouseOver.THARM.Search.ComparableCheck:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ComparableCheck (string fieldName, string humanReadableName, bool fieldRequired, Type fieldType, object minValue, object maxValue)
 Constructs a ComparableCheck instance with all details filled out immediately.
override bool Verify (object c)
 Verifies wether the value of c falls within the bounds of the minimum and maximum values minValue and maxValue.
 ComparableCheck (string fieldName, string humanReadableName, bool fieldRequired, Type fieldType, object minValue, object maxValue)
 Constructs a ComparableCheck instance with all details filled out immediately.
override bool Verify (object c)
 Verifies wether the value of c falls within the bounds of the minimum and maximum values minValue and maxValue.

Properties

object MaxValue [get, set]
 Gets and sets the maximum value (We would love for this to have the IComparable type, BUT then the program crashes on deserialization).
object MinValue [get, set]
 Gets and sets the minimum value (We would love for this to have the IComparable type, BUT then the program crashes on deserialization).

Private Attributes

object minValue
 The minimum value the verified object must match.
object maxValue
 The maximum value the verified object must match.

Detailed Description

A class designed to check wether a value is between a minimum and maximum value, or equal to either.

Definition at line 11 of file ComparableCheck.cs.


Constructor & Destructor Documentation

HouseOver.THARM.Search.ComparableCheck.ComparableCheck ( string  fieldName,
string  humanReadableName,
bool  fieldRequired,
Type  fieldType,
object  minValue,
object  maxValue 
)

Constructs a ComparableCheck instance with all details filled out immediately.

Parameters:
fieldName The name of the field
humanReadableName The human readable name of the field
fieldRequired Wether or not the field is required
fieldType The type of the field
minValue The mínimum required value
maxValue The maximum required value

Definition at line 51 of file ComparableCheck.cs.

00052             : base(fieldName, humanReadableName, fieldRequired, fieldType)
00053         {
00054             this.minValue = minValue;
00055             this.maxValue = maxValue;
00056 
00057         }

HouseOver.THARM.Search.ComparableCheck.ComparableCheck ( string  fieldName,
string  humanReadableName,
bool  fieldRequired,
Type  fieldType,
object  minValue,
object  maxValue 
)

Constructs a ComparableCheck instance with all details filled out immediately.

Parameters:
fieldName The name of the field
humanReadableName The human readable name of the field
fieldRequired Wether or not the field is required
fieldType The type of the field
minValue The mínimum required value
maxValue The maximum required value

Definition at line 51 of file ComparableCheck.cs.

00052             : base(fieldName, humanReadableName, fieldRequired, fieldType)
00053         {
00054             this.minValue = minValue;
00055             this.maxValue = maxValue;
00056 
00057         }


Member Function Documentation

override bool HouseOver.THARM.Search.ComparableCheck.Verify ( object  c  )  [virtual]

Verifies wether the value of c falls within the bounds of the minimum and maximum values minValue and maxValue.

Parameters:
c The object to check the validity of
Returns:
True if c falls between the two values

Implements HouseOver.THARM.Search.Check.

Definition at line 64 of file ComparableCheck.cs.

00065         {
00066             if (minValue == null || maxValue == null || !fieldRequired)
00067                 return true;
00068             IComparable ic;
00069             try
00070             {
00071                 ic = (IComparable)Convert.ChangeType(c, FieldType);
00072             }
00073             catch  {
00074                 return false;
00075             }
00076             return ic.CompareTo(minValue) >= 0 && ic.CompareTo(maxValue) <= 0;
00077         }

override bool HouseOver.THARM.Search.ComparableCheck.Verify ( object  c  )  [virtual]

Verifies wether the value of c falls within the bounds of the minimum and maximum values minValue and maxValue.

Parameters:
c The object to check the validity of
Returns:
True if c falls between the two values

Implements HouseOver.THARM.Search.Check.

Definition at line 64 of file ComparableCheck.cs.

00065         {
00066             if (minValue == null || maxValue == null || !fieldRequired)
00067                 return true;
00068             IComparable ic;
00069             try
00070             {
00071                 ic = (IComparable)Convert.ChangeType(c, FieldType);
00072             }
00073             catch  {
00074                 return false;
00075             }
00076             return ic.CompareTo(minValue) >= 0 && ic.CompareTo(maxValue) <= 0;
00077         }


Member Data Documentation

object HouseOver::THARM::Search.ComparableCheck::minValue [private]

The minimum value the verified object must match.

Definition at line 14 of file ComparableCheck.cs.

object HouseOver::THARM::Search.ComparableCheck::maxValue [private]

The maximum value the verified object must match.

Definition at line 16 of file ComparableCheck.cs.


Property Documentation

object HouseOver::THARM::Search.ComparableCheck::MaxValue [get, set]

Gets and sets the maximum value (We would love for this to have the IComparable type, BUT then the program crashes on deserialization).

Definition at line 22 of file ComparableCheck.cs.

Referenced by HouseOver.THARM.RealtyManager.SetComparableCheck(), and HouseOver.THARM.RealtyManager.ShowProfileDetails().

object HouseOver::THARM::Search.ComparableCheck::MinValue [get, set]

Gets and sets the minimum value (We would love for this to have the IComparable type, BUT then the program crashes on deserialization).

Definition at line 34 of file ComparableCheck.cs.

Referenced by HouseOver.THARM.RealtyManager.SetComparableCheck(), and HouseOver.THARM.RealtyManager.ShowProfileDetails().


The documentation for this class was generated from the following files:
Generated on Wed Jan 10 03:43:20 2007 for THARM by  doxygen 1.5.1-p1