Class DecimalFormatValidationRule
Validation rule for decimal numbers checking size and precision
public sealed class DecimalFormatValidationRule : ValidationRule<DecimalFormatValidationRuleProperties, DecimalFormatValidationRuleClientProperties, decimal?>, IValidationRule
- Inheritance
-
objectValidationRule<DecimalFormatValidationRuleProperties, DecimalFormatValidationRuleClientProperties, decimal?>DecimalFormatValidationRule
- Implements
- Inherited Members
- Extension Methods
Constructors
DecimalFormatValidationRule(VariableFormComponentProperties, ILocalizationService)
Creates a new instance of DecimalFormatValidationRule class.
public DecimalFormatValidationRule(VariableFormComponentProperties properties, ILocalizationService localizationService)
Parameters
properties
VariableFormComponentPropertieslocalizationService
ILocalizationService
Properties
ClientRuleName
Gets the client rule name identifier.
public override string ClientRuleName { get; }
Property Value
- string
DefaultErrorMessage
Defines default error message of the validation rule.
protected override string DefaultErrorMessage { get; }
Property Value
- string
Methods
ConfigureClientProperties(DecimalFormatValidationRuleClientProperties)
Allows set validation rule client properties.
protected override Task ConfigureClientProperties(DecimalFormatValidationRuleClientProperties clientProperties)
Parameters
clientProperties
DecimalFormatValidationRuleClientPropertiesCurrent instance of client properties.
Returns
- Task
Validate(decimal?, IFormFieldValueProvider)
Validates value
and returns the validation result.
public override Task<ValidationResult> Validate(decimal? value, IFormFieldValueProvider formFieldValueProvider)
Parameters
value
decimal?Value to be validated.
formFieldValueProvider
IFormFieldValueProviderProvider of values of other form fields for contextual validation.
Returns
- Task<ValidationResult>
Returns validation result with IsValid set to true, if value is valid. Otherwise returns result with the flag set to false and a corresponding error message.