Class AssetSelectorExtensionValidationRule
Validation rule checking asset file existence designed for AssetSelectorComponent.
public sealed class AssetSelectorExtensionValidationRule : ValidationRule<AssetSelectorExtensionValidationRuleProperties, AssetSelectorExtensionValidationRuleClientProperties, IEnumerable<AssetRelatedItem>>, IValidationRule
- Inheritance
-
objectValidationRule<AssetSelectorExtensionValidationRuleProperties, AssetSelectorExtensionValidationRuleClientProperties, IEnumerable<AssetRelatedItem>>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
ILocalizationServiceLocalization 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
AssetSelectorExtensionValidationRuleClientPropertiesCurrent 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.