C# Class Argentini.Halide.H3Identify

The H3Identify class contains methods and properties for comparing and identifying information.
ファイルを表示 Open project: argentini/Halide

Public Methods

Method Description
HasDomainNames ( string strVar ) : System.Boolean

Determines if a string has one or more domain names in it.

HasPattern ( string pattern, string input ) : System.Boolean

Checks to see if the passed input has the passed pattern

HasPatterns ( string patterns, string input ) : System.Boolean

Checks the passed input to make sure it has all the patterns in the passed patterns array.

IsBoolean ( string input ) : System.Boolean

Determines if a string value is a Boolean value or not.

IsCurrency ( string input ) : System.Boolean

Determines if a string value is currency.

IsDate ( string input ) : System.Boolean

Determines if a string value is a valid date.

IsEmail ( string inputEmail ) : System.Boolean

Uses RegEx to validate the format of an e-mail address.

IsNumeric ( string input ) : System.Boolean

Determines if a string value is numeric, but not currency.

IsPureNumeric ( string input ) : System.Boolean

Determines if a string value is numeric, with no symbols, commas, or decimal points.

IsState ( string stateCode ) : System.Boolean

Determine if a given string matches a 2-letter state abbreviation.

Ispassword ( string inputpassword, int minLen, int maxLen ) : System.Boolean

Uses RegEx to check for password formatting. Alpha-numeric characters and basic typewriter symbols are allowed.

Validate ( string value, ValidationOptions valType ) : String

Run data type and field length validation on a specific value. Certain types of validators obviate the need to specify a minimum or maximum length, like ValidationOptions.Email. using Argentini.Halide; ... string result = H3Identify.Validate( value, H3Identify.ValidationOptions.Email);

A common practice is to add error message fields underneath each of your form fields, and then use a single line to validate the input and display the error on the form, as well as set a global flag that identifies that there has been an error.

using Argentini.Halide; ... errorFlag += EmailFieldErrorMessage.InnerHtml = H3Identify.Validate( EmailField.Value, H3Identify.ValidationOptions.Email);

In this way, you can check "errorFlag" to see if it's empty or null, in which case, there were no validation errors, otherwise, you know one or more validations failed. And in the same line, the error message for each field is filled with the error message, since ValidateItem() returns an empty string if the validation is successful, or a friendly error string if it fails.

Validate ( string value, ValidationOptions valType, System.Boolean opt ) : String

Run data type validation on a specific value. using Argentini.Halide; ... string result = H3Identify.Validate( value, H3Identify.ValidationOptions.Email, false);

A common practice is to add error message fields underneath each of your form fields, and then use a single line to validate the input and display the error on the form, as well as set a global flag that identifies that there has been an error.

using Argentini.Halide; ... errorFlag += EmailFieldErrorMessage.InnerHtml = H3Identify.Validate( EmailField.Value, H3Identify.ValidationOptions.Email, false);

In this way, you can check "errorFlag" to see if it's empty or null, in which case, there were no validation errors, otherwise, you know one or more validations failed. And in the same line, the error message for each field is filled with the error message, since ValidateItem() returns an empty string if the validation is successful, or a friendly error string if it fails.

Validate ( string value, ValidationOptions valType, int minLength, int maxLength ) : String

Run data type and field length validation on a specific value. Certain types of validators obviate the need to specify a minimum or maximum length, like ValidationOptions.Email. using Argentini.Halide; ... string result = H3Identify.Validate( value, H3Identify.ValidationOptions.Email, 0, 0);

A common practice is to add error message fields underneath each of your form fields, and then use a single line to validate the input and display the error on the form, as well as set a global flag that identifies that there has been an error.

using Argentini.Halide; ... errorFlag += EmailFieldErrorMessage.InnerHtml = H3Identify.Validate( EmailField.Value, H3Identify.ValidationOptions.Email, 0, 0);

In this way, you can check "errorFlag" to see if it's empty or null, in which case, there were no validation errors, otherwise, you know one or more validations failed. And in the same line, the error message for each field is filled with the error message, since ValidateItem() returns an empty string if the validation is successful, or a friendly error string if it fails.

Validate ( string value, ValidationOptions valType, int minLength, int maxLength, System.Boolean opt ) : String

Run data type and field length validation on a specific value. Certain types of validators obviate the need to specify a minimum or maximum length, like ValidationOptions.Email. using Argentini.Halide; ... string result = H3Identify.Validate( value, H3Identify.ValidationOptions.Email, 0, 0, false);

A common practice is to add error message fields underneath each of your form fields, and then use a single line to validate the input and display the error on the form, as well as set a global flag that identifies that there has been an error.

using Argentini.Halide; ... errorFlag += EmailFieldErrorMessage.InnerHtml = H3Identify.Validate( EmailField.Value, H3Identify.ValidationOptions.Email, 0, 0, false);

In this way, you can check "errorFlag" to see if it's empty or null, in which case, there were no validation errors, otherwise, you know one or more validations failed. And in the same line, the error message for each field is filled with the error message, since ValidateItem() returns an empty string if the validation is successful, or a friendly error string if it fails.

Validate ( string value, int minLength, int maxLength ) : String

Run field length validation on a specific value. using Argentini.Halide; ... string result = H3Identify.Validate( value, 6, 25);

A common practice is to add error message fields underneath each of your form fields, and then use a single line to validate the input and display the error on the form, as well as set a global flag that identifies that there has been an error.

using Argentini.Halide; ... errorFlag += EmailFieldErrorMessage.InnerHtml = H3Identify.Validate( EmailField.Value, 6, 25);

In this way, you can check "errorFlag" to see if it's empty or null, in which case, there were no validation errors, otherwise, you know one or more validations failed. And in the same line, the error message for each field is filled with the error message, since ValidateItem() returns an empty string if the validation is successful, or a friendly error string if it fails.

Validate ( string value, string valueList, string delimitters, string errorMsg, System.Boolean useCase ) : String

Verify that a given value is equal to a value in a delimitted list of provided values.

Private Methods

Method Description
H3Identify ( ) : System

Method Details

HasDomainNames() public static method

Determines if a string has one or more domain names in it.
public static HasDomainNames ( string strVar ) : System.Boolean
strVar string String to process.
return System.Boolean

HasPattern() public static method

Checks to see if the passed input has the passed pattern
public static HasPattern ( string pattern, string input ) : System.Boolean
pattern string The pattern to use.
input string The input to check.
return System.Boolean

HasPatterns() public static method

Checks the passed input to make sure it has all the patterns in the passed patterns array.
public static HasPatterns ( string patterns, string input ) : System.Boolean
patterns string Array of patterns.
input string String value to check.
return System.Boolean

IsBoolean() public static method

Determines if a string value is a Boolean value or not.
public static IsBoolean ( string input ) : System.Boolean
input string The string to validate.
return System.Boolean

IsCurrency() public static method

Determines if a string value is currency.
public static IsCurrency ( string input ) : System.Boolean
input string The string to process.
return System.Boolean

IsDate() public static method

Determines if a string value is a valid date.
public static IsDate ( string input ) : System.Boolean
input string The string to process.
return System.Boolean

IsEmail() public static method

Uses RegEx to validate the format of an e-mail address.
public static IsEmail ( string inputEmail ) : System.Boolean
inputEmail string E-mail address to validate.
return System.Boolean

IsNumeric() public static method

Determines if a string value is numeric, but not currency.
public static IsNumeric ( string input ) : System.Boolean
input string The string to process.
return System.Boolean

IsPureNumeric() public static method

Determines if a string value is numeric, with no symbols, commas, or decimal points.
public static IsPureNumeric ( string input ) : System.Boolean
input string The string to process.
return System.Boolean

IsState() public static method

Determine if a given string matches a 2-letter state abbreviation.
public static IsState ( string stateCode ) : System.Boolean
stateCode string 2-letter state abbreviation to check.
return System.Boolean

Ispassword() public static method

Uses RegEx to check for password formatting. Alpha-numeric characters and basic typewriter symbols are allowed.
public static Ispassword ( string inputpassword, int minLen, int maxLen ) : System.Boolean
inputpassword string password string to validate.
minLen int Minimum length of valid password.
maxLen int Maximum length for valid password.
return System.Boolean

Validate() public static method

Run data type and field length validation on a specific value. Certain types of validators obviate the need to specify a minimum or maximum length, like ValidationOptions.Email. using Argentini.Halide; ... string result = H3Identify.Validate( value, H3Identify.ValidationOptions.Email);

A common practice is to add error message fields underneath each of your form fields, and then use a single line to validate the input and display the error on the form, as well as set a global flag that identifies that there has been an error.

using Argentini.Halide; ... errorFlag += EmailFieldErrorMessage.InnerHtml = H3Identify.Validate( EmailField.Value, H3Identify.ValidationOptions.Email);

In this way, you can check "errorFlag" to see if it's empty or null, in which case, there were no validation errors, otherwise, you know one or more validations failed. And in the same line, the error message for each field is filled with the error message, since ValidateItem() returns an empty string if the validation is successful, or a friendly error string if it fails.

public static Validate ( string value, ValidationOptions valType ) : String
value string Value to validate.
valType ValidationOptions Constant determining what type of validation.
return String

Validate() public static method

Run data type validation on a specific value. using Argentini.Halide; ... string result = H3Identify.Validate( value, H3Identify.ValidationOptions.Email, false);

A common practice is to add error message fields underneath each of your form fields, and then use a single line to validate the input and display the error on the form, as well as set a global flag that identifies that there has been an error.

using Argentini.Halide; ... errorFlag += EmailFieldErrorMessage.InnerHtml = H3Identify.Validate( EmailField.Value, H3Identify.ValidationOptions.Email, false);

In this way, you can check "errorFlag" to see if it's empty or null, in which case, there were no validation errors, otherwise, you know one or more validations failed. And in the same line, the error message for each field is filled with the error message, since ValidateItem() returns an empty string if the validation is successful, or a friendly error string if it fails.

public static Validate ( string value, ValidationOptions valType, System.Boolean opt ) : String
value string Value to validate.
valType ValidationOptions Constant determining what type of validation.
opt System.Boolean Field is optional. Zero length validates, otherwise, full validation occurs.
return String

Validate() public static method

Run data type and field length validation on a specific value. Certain types of validators obviate the need to specify a minimum or maximum length, like ValidationOptions.Email. using Argentini.Halide; ... string result = H3Identify.Validate( value, H3Identify.ValidationOptions.Email, 0, 0);

A common practice is to add error message fields underneath each of your form fields, and then use a single line to validate the input and display the error on the form, as well as set a global flag that identifies that there has been an error.

using Argentini.Halide; ... errorFlag += EmailFieldErrorMessage.InnerHtml = H3Identify.Validate( EmailField.Value, H3Identify.ValidationOptions.Email, 0, 0);

In this way, you can check "errorFlag" to see if it's empty or null, in which case, there were no validation errors, otherwise, you know one or more validations failed. And in the same line, the error message for each field is filled with the error message, since ValidateItem() returns an empty string if the validation is successful, or a friendly error string if it fails.

public static Validate ( string value, ValidationOptions valType, int minLength, int maxLength ) : String
value string Value to validate.
valType ValidationOptions Constant determining what type of validation.
minLength int Minimum length alowed.
maxLength int Maximum length allowed.
return String

Validate() public static method

Run data type and field length validation on a specific value. Certain types of validators obviate the need to specify a minimum or maximum length, like ValidationOptions.Email. using Argentini.Halide; ... string result = H3Identify.Validate( value, H3Identify.ValidationOptions.Email, 0, 0, false);

A common practice is to add error message fields underneath each of your form fields, and then use a single line to validate the input and display the error on the form, as well as set a global flag that identifies that there has been an error.

using Argentini.Halide; ... errorFlag += EmailFieldErrorMessage.InnerHtml = H3Identify.Validate( EmailField.Value, H3Identify.ValidationOptions.Email, 0, 0, false);

In this way, you can check "errorFlag" to see if it's empty or null, in which case, there were no validation errors, otherwise, you know one or more validations failed. And in the same line, the error message for each field is filled with the error message, since ValidateItem() returns an empty string if the validation is successful, or a friendly error string if it fails.

public static Validate ( string value, ValidationOptions valType, int minLength, int maxLength, System.Boolean opt ) : String
value string Value to validate.
valType ValidationOptions Constant determining what type of validation.
minLength int Minimum length alowed.
maxLength int Maximum length allowed.
opt System.Boolean Field is optional. Zero length validates, otherwise, full validation occurs.
return String

Validate() public static method

Run field length validation on a specific value. using Argentini.Halide; ... string result = H3Identify.Validate( value, 6, 25);

A common practice is to add error message fields underneath each of your form fields, and then use a single line to validate the input and display the error on the form, as well as set a global flag that identifies that there has been an error.

using Argentini.Halide; ... errorFlag += EmailFieldErrorMessage.InnerHtml = H3Identify.Validate( EmailField.Value, 6, 25);

In this way, you can check "errorFlag" to see if it's empty or null, in which case, there were no validation errors, otherwise, you know one or more validations failed. And in the same line, the error message for each field is filled with the error message, since ValidateItem() returns an empty string if the validation is successful, or a friendly error string if it fails.

public static Validate ( string value, int minLength, int maxLength ) : String
value string Value to validate.
minLength int Minimum length alowed.
maxLength int Maximum length allowed.
return String

Validate() public static method

Verify that a given value is equal to a value in a delimitted list of provided values.
public static Validate ( string value, string valueList, string delimitters, string errorMsg, System.Boolean useCase ) : String
value string Value to compare
valueList string Delimitted list of possible matches for comparison.
delimitters string Delimitter string which defines the delimitted list of values passed in parameter "ValueList"
errorMsg string Error message to return if match is not found.
useCase System.Boolean Set to true to compare values using case sensitivity, or false to ignore case.
return String