HouseOver.THARM.Search.EnumCheck Class Reference

A class designed to check the validity of an enumerated field. Extends the Check abstract class. More...

Inheritance diagram for HouseOver.THARM.Search.EnumCheck:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 EnumCheck (string fieldName, string humanReadableName, bool fieldRequired, Type fieldType)
 Constructs an EnumCheck instance and fills out the information into the properties provided by the Check abstract class.
override bool Verify (object obj)
 Checks wether the object is a valid instance of the FieldType type (as in, both correct type, and not false).
 EnumCheck (string fieldName, string humanReadableName, bool fieldRequired, Type fieldType)
 Constructs an EnumCheck instance and fills out the information into the properties provided by the Check abstract class.
override bool Verify (object obj)
 Checks wether the object is a valid instance of the FieldType type (as in, both correct type, and not false).

Properties

Enum Value [get, set]
 Gets and sets the enum.

Private Attributes

Enum value
 The enum to check.

Detailed Description

A class designed to check the validity of an enumerated field. Extends the Check abstract class.

Definition at line 12 of file EnumCheck.cs.


Constructor & Destructor Documentation

HouseOver.THARM.Search.EnumCheck.EnumCheck ( string  fieldName,
string  humanReadableName,
bool  fieldRequired,
Type  fieldType 
)

Constructs an EnumCheck instance and fills out the information into the properties provided by the Check abstract class.

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

Definition at line 31 of file EnumCheck.cs.

00031                                                                                                          : base(fieldName, humanReadableName, fieldRequired, fieldType)
00032         {
00033         }

HouseOver.THARM.Search.EnumCheck.EnumCheck ( string  fieldName,
string  humanReadableName,
bool  fieldRequired,
Type  fieldType 
)

Constructs an EnumCheck instance and fills out the information into the properties provided by the Check abstract class.

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

Definition at line 31 of file EnumCheck.cs.

00031                                                                                                          : base(fieldName, humanReadableName, fieldRequired, fieldType)
00032         {
00033         }


Member Function Documentation

override bool HouseOver.THARM.Search.EnumCheck.Verify ( object  obj  )  [virtual]

Checks wether the object is a valid instance of the FieldType type (as in, both correct type, and not false).

Parameters:
obj The object to check
Returns:
True if the object is a valid instance of FieldType, or if it is not a required field

Implements HouseOver.THARM.Search.Check.

Definition at line 40 of file EnumCheck.cs.

00041         {
00042             if (!fieldRequired)
00043                 return true;
00044 
00045             if (!FieldType.IsInstanceOfType(obj))
00046                 return false;
00047 
00048             Enum e = obj as Enum;
00049             if (e == null)
00050                 return false;
00051 
00052             return e.Equals(value);
00053         }

override bool HouseOver.THARM.Search.EnumCheck.Verify ( object  obj  )  [virtual]

Checks wether the object is a valid instance of the FieldType type (as in, both correct type, and not false).

Parameters:
obj The object to check
Returns:
True if the object is a valid instance of FieldType, or if it is not a required field

Implements HouseOver.THARM.Search.Check.

Definition at line 40 of file EnumCheck.cs.

00041         {
00042             if (!fieldRequired)
00043                 return true;
00044 
00045             if (!FieldType.IsInstanceOfType(obj))
00046                 return false;
00047 
00048             Enum e = obj as Enum;
00049             if (e == null)
00050                 return false;
00051 
00052             return e.Equals(value);
00053         }


Member Data Documentation

Enum HouseOver::THARM::Search.EnumCheck::value [private]

The enum to check.

Definition at line 15 of file EnumCheck.cs.


Property Documentation

Enum HouseOver::THARM::Search.EnumCheck::Value [get, set]

Gets and sets the enum.

Definition at line 19 of file EnumCheck.cs.

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


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