Class ModelLocalizationValidator
Validation helper for model localizations. Ensures that all validated elements are localized.
Inheritance
Inherited Members
Namespace: TimeCockpit.Data.Localization.Default
Assembly: TimeCockpit.Data.dll
Syntax
public class ModelLocalizationValidator
Constructors
ModelLocalizationValidator(DefaultLocalizer, IEnumerable<String>, DefaultLocalizer)
Initializes a new instance of the ModelLocalizationValidator class.
Declaration
public ModelLocalizationValidator(DefaultLocalizer localizer, IEnumerable<string> cultures, DefaultLocalizer secondaryLocalizer = null)
Parameters
Type | Name | Description |
---|---|---|
DefaultLocalizer | localizer | Localizer to use for validation. |
System.Collections.Generic.IEnumerable<System.String> | cultures | Cultures to check. |
DefaultLocalizer | secondaryLocalizer | (Optional) secondary localizer to use for validation. |
Properties
Cultures
Gets the cultures to check.
Declaration
public string[] Cultures { get; }
Property Value
Type | Description |
---|---|
System.String[] |
Localizer
Gets the localizer to check.
Declaration
public DefaultLocalizer Localizer { get; }
Property Value
Type | Description |
---|---|
DefaultLocalizer |
Result
Gets the validation result.
Declaration
public List<string> Result { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.String> |
SecondaryLocalizer
Gets the secondary localizer to check.
Declaration
public DefaultLocalizer SecondaryLocalizer { get; }
Property Value
Type | Description |
---|---|
DefaultLocalizer |
Methods
Validate(ModelAction)
Validate a ModelAction. Ensures that all localizable elements are localized.
Declaration
public void Validate(ModelAction action)
Parameters
Type | Name | Description |
---|---|---|
ModelAction | action | ModelAction to validate. |
Validate(ModelAction, Permission)
Validate a action permission. Ensures that all localizable elements are localized.
Declaration
public void Validate(ModelAction action, Permission permission)
Parameters
Type | Name | Description |
---|---|---|
ModelAction | action | Parent action. |
Permission | permission | Permission to validate. |
Validate(EntityView)
Validate a EntityView. Ensures that all localizable elements are localized.
Declaration
public void Validate(EntityView entityView)
Parameters
Type | Name | Description |
---|---|---|
EntityView | entityView | EntityView to validate. |
Validate(EntityView, Permission)
Validate a entity view permission. Ensures that all localizable elements are localized.
Declaration
public void Validate(EntityView entityView, Permission permission)
Parameters
Type | Name | Description |
---|---|---|
EntityView | entityView | Parent entity view. |
Permission | permission | Permission to validate. |
Validate(Model, IEnumerable<String>)
Validate a Model. Ensures that all localizable elements within the model are localized.
Declaration
public void Validate(Model model, IEnumerable<string> excludedEntities = null)
Parameters
Type | Name | Description |
---|---|---|
Model | model | Model to validate against. |
System.Collections.Generic.IEnumerable<System.String> | excludedEntities | Optional list of entity names to exclude from validation. |
Validate(ModelEntityBase)
Validate a ModelEntity. Ensures that all localizable elements and children are localized.
Declaration
public void Validate(ModelEntityBase entity)
Parameters
Type | Name | Description |
---|---|---|
ModelEntityBase | entity | Entity to validate. |
Validate(ModelEntityBase, LogicalRelation)
Validate logical relations.
Declaration
public void Validate(ModelEntityBase entity, LogicalRelation relation)
Parameters
Type | Name | Description |
---|---|---|
ModelEntityBase | entity | Model entity. |
LogicalRelation | relation | Logical relation. |
Validate(ModelEntityBase, ModelProperty)
Validate a model entity relation. Ensures that all localizable elements are localized.
Declaration
public void Validate(ModelEntityBase entity, ModelProperty property)
Parameters
Type | Name | Description |
---|---|---|
ModelEntityBase | entity | Parent model entity. |
ModelProperty | property | Relation to validate. |
Validate(ModelEntityBase, ModelProperty, Permission)
Validate a property permission. Ensures that all localizable elements are localized.
Declaration
public void Validate(ModelEntityBase entity, ModelProperty property, Permission permission)
Parameters
Type | Name | Description |
---|---|---|
ModelEntityBase | entity | Parent model entity. |
ModelProperty | property | Parent property. |
Permission | permission | Permission to validate. |
Validate(ModelEntityBase, Relation)
Validate a model entity relation. Ensures that all localizable elements are localized.
Declaration
public void Validate(ModelEntityBase entity, Relation relation)
Parameters
Type | Name | Description |
---|---|---|
ModelEntityBase | entity | Parent model entity. |
Relation | relation | Relation to validate. |
Validate(ModelEntityBase, Relation, Permission)
Validate a relation permission. Ensures that all localizable elements are localized.
Declaration
public void Validate(ModelEntityBase entity, Relation relation, Permission permission)
Parameters
Type | Name | Description |
---|---|---|
ModelEntityBase | entity | Parent model entity. |
Relation | relation | Parent relation. |
Permission | permission | Permission to validate. |
Validate(ModelEntityBase, ValidationRule)
Validate a model entity validation rule. Ensures that all localizable elements are localized.
Declaration
public void Validate(ModelEntityBase entity, ValidationRule validationRule)
Parameters
Type | Name | Description |
---|---|---|
ModelEntityBase | entity | Parent model entity. |
ValidationRule | validationRule | Validation rule to validate. |
Validate(ModelEntityBase, Permission)
Validate a model entity permission. Ensures that all localizable elements are localized.
Declaration
public void Validate(ModelEntityBase entity, Permission permission)
Parameters
Type | Name | Description |
---|---|---|
ModelEntityBase | entity | Parent model entity. |
Permission | permission | Permission to validate. |
Validate(NamedSetDefinition)
Validate a NamedSetDefinition. Ensures that all localizable elements are localized.
Declaration
public void Validate(NamedSetDefinition namedSetDefinition)
Parameters
Type | Name | Description |
---|---|---|
NamedSetDefinition | namedSetDefinition | NamedSetDefinition to validate. |