C# Class Habanero.Faces.Base.ValidationUtil

Provide comparison of string data. This class currently implements System.Web.UI.WebControls validation so that we don't have to write more code. Eventually, we may want to implement out own code.
ファイルを表示 Open project: Chillisoft/habanero.faces

Public Methods

Method Description
CanConvert ( string text, System vdt ) : bool
CompareTypes ( string leftText, ValidationDataType type ) : bool
CompareValues ( string leftText, string rightText, ValidationCompareOperator op, ValidationDataType type ) : bool

Compare two values using provided operator and data type.

FileToString ( string sFile ) : string

Load the entire text file into a string.

FileToString ( string sFile, int size ) : string

Load the text file with specified size as return text.

ObjectToXmlString ( object obj ) : string

Write object to xml string.

StringToFile ( string strValue, string strFileName ) : void

Save a string to file.

StringToFile ( string strValue, string strFileName, bool bAppendToFile ) : void

Save a string to file.

ValidateRegEx ( string valueText, string patternText ) : bool

Utility method validation regular expression.

XmlStringToObject ( string xmlString, System type ) : object

Get object from an xml string.

Private Methods

Method Description
ValidationUtil ( ) : System

Disable default ctor.

Method Details

CanConvert() public static method

public static CanConvert ( string text, System vdt ) : bool
text string
vdt System
return bool

CompareTypes() public static method

public static CompareTypes ( string leftText, ValidationDataType type ) : bool
leftText string
type ValidationDataType
return bool

CompareValues() public static method

Compare two values using provided operator and data type.
public static CompareValues ( string leftText, string rightText, ValidationCompareOperator op, ValidationDataType type ) : bool
leftText string
rightText string
op ValidationCompareOperator
type ValidationDataType
return bool

FileToString() public static method

Load the entire text file into a string.
public static FileToString ( string sFile ) : string
sFile string Full pathname of file to read.
return string

FileToString() public static method

Load the text file with specified size as return text.
public static FileToString ( string sFile, int size ) : string
sFile string File to read from.
size int Number of char to read.
return string

ObjectToXmlString() public static method

Write object to xml string.
public static ObjectToXmlString ( object obj ) : string
obj object
return string

StringToFile() public static method

Save a string to file.
public static StringToFile ( string strValue, string strFileName ) : void
strValue string
strFileName string
return void

StringToFile() public static method

Save a string to file.
public static StringToFile ( string strValue, string strFileName, bool bAppendToFile ) : void
strValue string String value to save.
strFileName string File name to save to.
bAppendToFile bool True - to append string to file. Default false - overwrite file.
return void

ValidateRegEx() public static method

Utility method validation regular expression.
public static ValidateRegEx ( string valueText, string patternText ) : bool
valueText string
patternText string
return bool

XmlStringToObject() public static method

Get object from an xml string.
public static XmlStringToObject ( string xmlString, System type ) : object
xmlString string
type System
return object