C# Class Aqueduct.Extensions.Validation

Summary for the Validation class
Mostrar archivo Open project: aqueduct/Aqueduct.SitecoreLib

Public Methods

Method Description
CleanCreditCardNumber ( this creditCard ) : string

Cleans the credit card number, returning just the numeric values.

IsAlpha ( this evalString ) : bool

Determines whether the specified eval string contains only alpha characters.

IsAlphaNumeric ( this evalString ) : bool

Determines whether the specified eval string contains only alphanumeric characters

IsAlphaNumeric ( this evalString, bool allowSpaces ) : bool

Determines whether the specified eval string contains only alphanumeric characters

IsCreditCardAmericanExpress ( this creditCard ) : bool

Determines whether the specified string is an American Express card

IsCreditCardAny ( this creditCard ) : bool

Determines whether the specified string is a valid credit, based on matching any one of the eight credit card strings

IsCreditCardBigFour ( this creditCard ) : bool

Determines whether the specified string is an American Express, Discover, MasterCard, or Visa

IsCreditCardCarteBlanche ( this creditCard ) : bool

Determines whether the specified string is an Carte Blanche card

IsCreditCardDinersClub ( this creditCard ) : bool

Determines whether the specified string is an Diner's Club card

IsCreditCardDiscover ( this creditCard ) : bool

Determines whether the specified string is a Discover card

IsCreditCardEnRoute ( this creditCard ) : bool

Determines whether the specified string is an En Route card

IsCreditCardJCB ( this creditCard ) : bool

Determines whether the specified string is an JCB card

IsCreditCardMasterCard ( this creditCard ) : bool

Determines whether the specified string is a Master Card credit card

IsCreditCardVisa ( this creditCard ) : bool

Determines whether the specified string is Visa card.

IsEmail ( this emailAddressString ) : bool

Determines whether the specified email address string is valid based on regular expression evaluation.

IsGuid ( this guid ) : bool

Determines whether the specified string is a valid GUID.

IsIPAddress ( this ipAddress ) : bool

Determines whether the specified string is a valid IP address.

IsLowerCase ( this inputString ) : bool

Determines whether the specified string is lower case.

IsNumeric ( this evalString ) : bool

Determines whether the specified eval string contains only numeric characters

IsSocialSecurityNumber ( this socialSecurityNumber ) : bool

Determines whether the specified string is a valid Social Security number. Dashes are optional.

IsStringNumeric ( this str ) : bool

Determine whether the passed string is numeric, by attempting to parse it to a double

IsStrongPassword ( this password ) : bool

Determines whether the specified string is consider a strong password based on the supplied string.

IsURL ( this url ) : bool

Determines whether the specified string is a valid URL string using the referenced regex string.

IsUSCurrency ( this currency ) : bool

Determines whether the specified string is a valid currency string using the referenced regex string.

IsUSTelephoneNumber ( this telephoneNumber ) : bool

Determines whether the specified string is a valid US phone number using the referenced regex string.

IsUpperCase ( this inputString ) : bool

Determines whether the specified string is upper case.

IsValidLuhn ( this digits ) : bool

Determines whether the specified int array passes the Luhn algorith

IsZIPCodeAny ( this zipCode ) : bool

Determines whether the specified string is a valid US Zip Code, using either 5 or 5+4 format.

IsZIPCodeFive ( this zipCode ) : bool

Determines whether the specified string is a valid US Zip Code, using the 5 digit format.

IsZIPCodeFivePlusFour ( this zipCode ) : bool

Determines whether the specified string is a valid US Zip Code, using the 5+4 format.

Private Methods

Method Description
CreditPassesFormatCheck ( this creditCardNumber ) : bool

Determines whether the credit card number, once cleaned, passes the Luhn algorith. See: http://en.wikipedia.org/wiki/Luhn_algorithm

Method Details

CleanCreditCardNumber() public static method

Cleans the credit card number, returning just the numeric values.
public static CleanCreditCardNumber ( this creditCard ) : string
creditCard this The credit card.
return string

IsAlpha() public static method

Determines whether the specified eval string contains only alpha characters.
public static IsAlpha ( this evalString ) : bool
evalString this The eval string.
return bool

IsAlphaNumeric() public static method

Determines whether the specified eval string contains only alphanumeric characters
public static IsAlphaNumeric ( this evalString ) : bool
evalString this The eval string.
return bool

IsAlphaNumeric() public static method

Determines whether the specified eval string contains only alphanumeric characters
public static IsAlphaNumeric ( this evalString, bool allowSpaces ) : bool
evalString this The eval string.
allowSpaces bool if set to true [allow spaces].
return bool

IsCreditCardAmericanExpress() public static method

Determines whether the specified string is an American Express card
public static IsCreditCardAmericanExpress ( this creditCard ) : bool
creditCard this The credit card.
return bool

IsCreditCardAny() public static method

Determines whether the specified string is a valid credit, based on matching any one of the eight credit card strings
public static IsCreditCardAny ( this creditCard ) : bool
creditCard this The credit card.
return bool

IsCreditCardBigFour() public static method

Determines whether the specified string is an American Express, Discover, MasterCard, or Visa
public static IsCreditCardBigFour ( this creditCard ) : bool
creditCard this The credit card.
return bool

IsCreditCardCarteBlanche() public static method

Determines whether the specified string is an Carte Blanche card
public static IsCreditCardCarteBlanche ( this creditCard ) : bool
creditCard this The credit card.
return bool

IsCreditCardDinersClub() public static method

Determines whether the specified string is an Diner's Club card
public static IsCreditCardDinersClub ( this creditCard ) : bool
creditCard this The credit card.
return bool

IsCreditCardDiscover() public static method

Determines whether the specified string is a Discover card
public static IsCreditCardDiscover ( this creditCard ) : bool
creditCard this The credit card.
return bool

IsCreditCardEnRoute() public static method

Determines whether the specified string is an En Route card
public static IsCreditCardEnRoute ( this creditCard ) : bool
creditCard this The credit card.
return bool

IsCreditCardJCB() public static method

Determines whether the specified string is an JCB card
public static IsCreditCardJCB ( this creditCard ) : bool
creditCard this The credit card.
return bool

IsCreditCardMasterCard() public static method

Determines whether the specified string is a Master Card credit card
public static IsCreditCardMasterCard ( this creditCard ) : bool
creditCard this The credit card.
return bool

IsCreditCardVisa() public static method

Determines whether the specified string is Visa card.
public static IsCreditCardVisa ( this creditCard ) : bool
creditCard this The credit card.
return bool

IsEmail() public static method

Determines whether the specified email address string is valid based on regular expression evaluation.
public static IsEmail ( this emailAddressString ) : bool
emailAddressString this The email address string.
return bool

IsGuid() public static method

Determines whether the specified string is a valid GUID.
public static IsGuid ( this guid ) : bool
guid this The GUID.
return bool

IsIPAddress() public static method

Determines whether the specified string is a valid IP address.
public static IsIPAddress ( this ipAddress ) : bool
ipAddress this The ip address.
return bool

IsLowerCase() public static method

Determines whether the specified string is lower case.
public static IsLowerCase ( this inputString ) : bool
inputString this The input string.
return bool

IsNumeric() public static method

Determines whether the specified eval string contains only numeric characters
public static IsNumeric ( this evalString ) : bool
evalString this The eval string.
return bool

IsSocialSecurityNumber() public static method

Determines whether the specified string is a valid Social Security number. Dashes are optional.
public static IsSocialSecurityNumber ( this socialSecurityNumber ) : bool
socialSecurityNumber this The Social Security Number
return bool

IsStringNumeric() public static method

Determine whether the passed string is numeric, by attempting to parse it to a double
public static IsStringNumeric ( this str ) : bool
str this The string to evaluated for numeric conversion
return bool

IsStrongPassword() public static method

Determines whether the specified string is consider a strong password based on the supplied string.
public static IsStrongPassword ( this password ) : bool
password this The password.
return bool

IsURL() public static method

Determines whether the specified string is a valid URL string using the referenced regex string.
public static IsURL ( this url ) : bool
url this The URL string.
return bool

IsUSCurrency() public static method

Determines whether the specified string is a valid currency string using the referenced regex string.
public static IsUSCurrency ( this currency ) : bool
currency this The currency string.
return bool

IsUSTelephoneNumber() public static method

Determines whether the specified string is a valid US phone number using the referenced regex string.
public static IsUSTelephoneNumber ( this telephoneNumber ) : bool
telephoneNumber this The telephone number.
return bool

IsUpperCase() public static method

Determines whether the specified string is upper case.
public static IsUpperCase ( this inputString ) : bool
inputString this The input string.
return bool

IsValidLuhn() public static method

Determines whether the specified int array passes the Luhn algorith
public static IsValidLuhn ( this digits ) : bool
digits this The int array to evaluate
return bool

IsZIPCodeAny() public static method

Determines whether the specified string is a valid US Zip Code, using either 5 or 5+4 format.
public static IsZIPCodeAny ( this zipCode ) : bool
zipCode this The zip code.
return bool

IsZIPCodeFive() public static method

Determines whether the specified string is a valid US Zip Code, using the 5 digit format.
public static IsZIPCodeFive ( this zipCode ) : bool
zipCode this The zip code.
return bool

IsZIPCodeFivePlusFour() public static method

Determines whether the specified string is a valid US Zip Code, using the 5+4 format.
public static IsZIPCodeFivePlusFour ( this zipCode ) : bool
zipCode this The zip code.
return bool