Table of Contents

Class ContentItemAssetExtensionValidationRule

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

Validation rule for extension validation in the file uploaded using ContentItemFileUploaderComponent.

public sealed class ContentItemAssetExtensionValidationRule : ValidationRule<ContentItemAssetExtensionValidationRuleProperties, ContentItemAssetExtensionValidationRuleClientProperties, ContentItemAssetMetadata>, IValidationRule
Inheritance
object
ContentItemAssetExtensionValidationRule
Implements
Inherited Members
Extension Methods

Constructors

ContentItemAssetExtensionValidationRule(Func<ContentItemAssetMetadata>, ILocalizationService)

Initializes a new instance of ContentItemAssetExtensionValidationRule.

public ContentItemAssetExtensionValidationRule(Func<ContentItemAssetMetadata> valueProvider, ILocalizationService localizationService)

Parameters

valueProvider Func<ContentItemAssetMetadata>

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(ContentItemAssetExtensionValidationRuleClientProperties)

Allows set validation rule client properties.

protected override Task ConfigureClientProperties(ContentItemAssetExtensionValidationRuleClientProperties clientProperties)

Parameters

clientProperties ContentItemAssetExtensionValidationRuleClientProperties

Current instance of client properties.

Returns

Task

Validate(ContentItemAssetMetadata, IFormFieldValueProvider)

Validates value and returns the validation result.

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

Parameters

value ContentItemAssetMetadata

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.