Table of Contents

Class AssetSelectorExtensionValidationRule

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

Validation rule checking asset file existence designed for AssetSelectorComponent.

public sealed class AssetSelectorExtensionValidationRule : ValidationRule<AssetSelectorExtensionValidationRuleProperties, AssetSelectorExtensionValidationRuleClientProperties, IEnumerable<AssetRelatedItem>>, IValidationRule
Inheritance
object
AssetSelectorExtensionValidationRule
Implements
Inherited Members
Extension Methods

Constructors

AssetSelectorExtensionValidationRule(Func<IEnumerable<AssetRelatedItem>>, ILocalizationService)

Initializes a new instance of AssetSelectorExtensionValidationRule.

public AssetSelectorExtensionValidationRule(Func<IEnumerable<AssetRelatedItem>> valueProvider, ILocalizationService localizationService)

Parameters

valueProvider Func<IEnumerable<AssetRelatedItem>>

Delegate to provide component value.

localizationService ILocalizationService

Localization service.

Properties

ClientRuleName

Gets the client rule name identifier.

public override string ClientRuleName { get; }

Property Value

string

Methods

ConfigureClientProperties(AssetSelectorExtensionValidationRuleClientProperties)

Allows set validation rule client properties.

protected override Task ConfigureClientProperties(AssetSelectorExtensionValidationRuleClientProperties clientProperties)

Parameters

clientProperties AssetSelectorExtensionValidationRuleClientProperties

Current instance of client properties.

Returns

Task

Validate(IEnumerable<AssetRelatedItem>, IFormFieldValueProvider)

Validates value and returns the validation result.

public override Task<ValidationResult> Validate(IEnumerable<AssetRelatedItem> value, IFormFieldValueProvider formFieldValueProvider)

Parameters

value IEnumerable<AssetRelatedItem>
formFieldValueProvider IFormFieldValueProvider

Returns

Task<ValidationResult>

Remarks

Checks that all assets have valid file extension.