Class ExtensionSelectorValidationRule
Validation rule designed for ExtensionSelectorComponent.
public sealed class ExtensionSelectorValidationRule : ValidationRule<string>, IValidationRule
- Inheritance
-
objectValidationRule<string>ExtensionSelectorValidationRule
- Implements
- Inherited Members
- Extension Methods
Constructors
ExtensionSelectorValidationRule(ILocalizationService, string)
Initializes a new instance of AssetSelectorValidationRule.
public ExtensionSelectorValidationRule(ILocalizationService localizationService, string allowedExtensions)
Parameters
localizationService
ILocalizationServiceallowedExtensions
string
Methods
ConfigureClientProperties(ServerValidationRuleClientProperties)
Allows set validation rule client properties.
protected override Task ConfigureClientProperties(ServerValidationRuleClientProperties clientProperties)
Parameters
clientProperties
ServerValidationRuleClientPropertiesCurrent instance of client properties.
Returns
- Task
Validate(string, IFormFieldValueProvider)
Validates value
and returns the validation result.
public override Task<ValidationResult> Validate(string value, IFormFieldValueProvider formFieldValueProvider)
Parameters
value
stringValue 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.