Skip to the content.

PromptPlus API:PromptValidators

Build Publish License NuGet Downloads

Back to List Api

PromptValidators

Namespace: PPlus.Controls

Represents validation functions for controls

public static class PromptValidators

Inheritance ObjectPromptValidators

Methods

ImportValidators<T>(T, Expression<Func<T, Object>>)

Import validation from object to control

public static Func<Object, ValidationResult>[] ImportValidators<T>(T instance, Expression<Func<T, Object>> expression)

Type Parameters

T

Parameters

instance T

expression Expression<Func<T, Object>>

Returns

the Validation function

IsCurrency(CultureInfo, String)

Validation function for Currency

public static Func<Object, ValidationResult> IsCurrency(CultureInfo cultureinfo, string errorMessage)

Parameters

cultureinfo CultureInfo
Culture to validate

errorMessage String
Custom error message to show

Returns

the Validation function

IsDateTime(CultureInfo, String)

Validation function for DateTime

public static Func<Object, ValidationResult> IsDateTime(CultureInfo cultureinfo, string errorMessage)

Parameters

cultureinfo CultureInfo
Culture to validate

errorMessage String
Custom error message to show

Returns

the Validation function

IsNumber(CultureInfo, String)

Validation function for Number

public static Func<Object, ValidationResult> IsNumber(CultureInfo cultureinfo, string errorMessage)

Parameters

cultureinfo CultureInfo
Culture to validate

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeBoolean(String)

Validation function for Is type Boolean

public static Func<Object, ValidationResult> IsTypeBoolean(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeByte(String)

Validation function for Is type Byte

public static Func<Object, ValidationResult> IsTypeByte(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeChar(String)

Validation function for Is type Char

public static Func<Object, ValidationResult> IsTypeChar(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeDateTime(String)

Validation function for Is type DateTime

public static Func<Object, ValidationResult> IsTypeDateTime(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeDecimal(String)

Validation function for Is type Decimal

public static Func<Object, ValidationResult> IsTypeDecimal(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeDouble(String)

Validation function for Is type Double

public static Func<Object, ValidationResult> IsTypeDouble(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeFloat(String)

Validation function for Is type Float

public static Func<Object, ValidationResult> IsTypeFloat(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeInt(String)

Validation function for Is type Int

public static Func<Object, ValidationResult> IsTypeInt(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeInt16(String)

Validation function for Is type Int16

public static Func<Object, ValidationResult> IsTypeInt16(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeInt32(String)

Validation function for Is type Int32

public static Func<Object, ValidationResult> IsTypeInt32(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeInt64(String)

Validation function for Is type Int64

public static Func<Object, ValidationResult> IsTypeInt64(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeLong(String)

Validation function for Is type Long

public static Func<Object, ValidationResult> IsTypeLong(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeSByte(String)

Validation function for Is type SByte

public static Func<Object, ValidationResult> IsTypeSByte(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeShort(String)

Validation function for Is type Short

public static Func<Object, ValidationResult> IsTypeShort(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeSingle(String)

Validation function for Is type Single

public static Func<Object, ValidationResult> IsTypeSingle(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeUInt(String)

Validation function for Is type UInt

public static Func<Object, ValidationResult> IsTypeUInt(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeUInt16(String)

Validation function for Is type UInt16

public static Func<Object, ValidationResult> IsTypeUInt16(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeUInt32(String)

Validation function for Is type UInt32

public static Func<Object, ValidationResult> IsTypeUInt32(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeUInt64(String)

Validation function for Is type UInt64

public static Func<Object, ValidationResult> IsTypeUInt64(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeULong(String)

Validation function for Is type ULong

public static Func<Object, ValidationResult> IsTypeULong(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsTypeUshort(String)

Validation function for Is type Ushort

public static Func<Object, ValidationResult> IsTypeUshort(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function

IsUriScheme(UriKind, String, String)

Validation function for Uri Scheme

public static Func<Object, ValidationResult> IsUriScheme(UriKind uriKind, string allowedUriSchemes, string errorMessage)

Parameters

uriKind UriKind
Kind of uri

allowedUriSchemes String
list of allowed uri scheme. Schemes must be separated by a semicolon.

errorMessage String
Custom error message to show

Returns

the Validation function

MaxLength(Int32, String)

Validation function for MaxLength

public static Func<Object, ValidationResult> MaxLength(int length, string errorMessage)

Parameters

length Int32
MaxLength value

errorMessage String
Custom error message to show

Returns

the Validation function

MinLength(Int32, String)

Validation function for MinLength

public static Func<Object, ValidationResult> MinLength(int length, string errorMessage)

Parameters

length Int32
MinLength value

errorMessage String
Custom error message to show

Returns

the Validation function

RegularExpression(String, String)

Validation function for RegularExpression

public static Func<Object, ValidationResult> RegularExpression(string pattern, string errorMessage)

Parameters

pattern String
RegularExpression value

errorMessage String
Custom error message to show

Returns

the Validation function

Required(String)

Validation function for Required

public static Func<Object, ValidationResult> Required(string errorMessage)

Parameters

errorMessage String
Custom error message to show

Returns

the Validation function


Back to List Api