Table of Contents

Class ExtensionSelectorValidationRule

Namespace
Kentico.Xperience.Admin.Base.Forms
Assembly
Kentico.Xperience.Admin.Base.dll

Validation rule designed for ExtensionSelectorComponent.

public sealed class ExtensionSelectorValidationRule : ValidationRule<string>, IValidationRule
Inheritance
object
ExtensionSelectorValidationRule
Implements
Inherited Members
Extension Methods

Constructors

ExtensionSelectorValidationRule(ILocalizationService, string)

Initializes a new instance of AssetSelectorValidationRule.

public ExtensionSelectorValidationRule(ILocalizationService localizationService, string allowedExtensions)

Parameters

localizationService ILocalizationService
allowedExtensions string

Methods

ConfigureClientProperties(ServerValidationRuleClientProperties)

Allows set validation rule client properties.

protected override Task ConfigureClientProperties(ServerValidationRuleClientProperties clientProperties)

Parameters

clientProperties ServerValidationRuleClientProperties

Current 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 string

Value to be validated.

formFieldValueProvider IFormFieldValueProvider

Provider 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.