Table of Contents

Class CodeNameValidationRule

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

Validates whether field value is a valid code name.

[ValidationRuleAttribute(typeof(CodeNameValidationRuleAttribute))]
public sealed class CodeNameValidationRule : ValidationRule<string>, IValidationRule
Inheritance
object
CodeNameValidationRule
Implements
Inherited Members
Extension Methods

Constructors

CodeNameValidationRule(ILocalizationService)

Creates a new instance of CodeNameValidationRule class.

public CodeNameValidationRule(ILocalizationService localizationService)

Parameters

localizationService ILocalizationService

Properties

DefaultErrorMessage

Defines default error message of the validation rule.

protected override string DefaultErrorMessage { get; }

Property Value

string

Methods

Validate(string, IFormFieldValueProvider)

Validates whether value is a valid code name.

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>