Table of Contents

Class ValidationRuleActivator

Namespace
Kentico.Forms.Web.Mvc
Assembly
Kentico.Content.Web.Mvc.dll

Contains methods for creating ValidationRules.

public class ValidationRuleActivator : IValidationRuleActivator
Inheritance
object
ValidationRuleActivator
Implements
Extension Methods

Constructors

ValidationRuleActivator(IValidationRuleDefinitionProvider)

Initializes a new instance of the ValidationRuleActivator class.

public ValidationRuleActivator(IValidationRuleDefinitionProvider validationRuleDefinitionProvider)

Parameters

validationRuleDefinitionProvider IValidationRuleDefinitionProvider

Retrieves ValidationRuleDefinitions.

Methods

CreateValidationRule(ValidationRuleDefinition)

Creates a new instance of the ValidationRule specified by its definition with default property values.

public ValidationRule CreateValidationRule(ValidationRuleDefinition definition)

Parameters

definition ValidationRuleDefinition

Defines ValidationRule which is to be created.

Returns

ValidationRule

Returns an instance of ValidationRule as described by its definition.

Exceptions

ArgumentNullException

Thrown when definition is null.

CreateValidationRule(string)

Creates a new instance of the ValidationRule specified by its definition with default property values.

public ValidationRule CreateValidationRule(string validationRuleIdentifier)

Parameters

validationRuleIdentifier string

Identifies ValidationRule which is to be created.

Returns

ValidationRule

Returns an instance of ValidationRule as described by its definition.

Exceptions

ArgumentNullException

Thrown when validationRuleIdentifier is null or empty.

InvalidOperationException

Thrown when ValidationRule with given validationRuleIdentifier is not registered in the system.