C# Класс 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.
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
ValidationUtil ( ) : System

Disable default ctor.

Описание методов

CanConvert() публичный статический Метод

public static CanConvert ( string text, System vdt ) : bool
text string
vdt System
Результат bool

CompareTypes() публичный статический Метод

public static CompareTypes ( string leftText, ValidationDataType type ) : bool
leftText string
type ValidationDataType
Результат bool

CompareValues() публичный статический Метод

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
Результат bool

FileToString() публичный статический Метод

Load the entire text file into a string.
public static FileToString ( string sFile ) : string
sFile string Full pathname of file to read.
Результат string

FileToString() публичный статический Метод

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.
Результат string

ObjectToXmlString() публичный статический Метод

Write object to xml string.
public static ObjectToXmlString ( object obj ) : string
obj object
Результат string

StringToFile() публичный статический Метод

Save a string to file.
public static StringToFile ( string strValue, string strFileName ) : void
strValue string
strFileName string
Результат void

StringToFile() публичный статический Метод

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.
Результат void

ValidateRegEx() публичный статический Метод

Utility method validation regular expression.
public static ValidateRegEx ( string valueText, string patternText ) : bool
valueText string
patternText string
Результат bool

XmlStringToObject() публичный статический Метод

Get object from an xml string.
public static XmlStringToObject ( string xmlString, System type ) : object
xmlString string
type System
Результат object