Class ModelElementRule<TElement>
Denotes a rule that is used to create model elements
public class ModelElementRule<TElement> : ElementRule<TElement> where TElement : IModelElement
Type Parameters
TElementthe type of elements to create
- Inheritance
-
ElementRule<TElement>ModelElementRule<TElement>
- Derived
- Inherited Members
Methods
Validate(Func<TElement, ParseContext, string>, DiagnosticSeverity)
Instructs the rule to validate elements using the given validator method, revalidating after every parse run
protected void Validate(Func<TElement, ParseContext, string> validator, DiagnosticSeverity severity = DiagnosticSeverity.Error)
Parameters
validatorFunc<TElement, ParseContext, string>a function to validate elements
severityDiagnosticSeveritythe severity of errors
Validate(TElement, RuleApplication, ParseContext)
Validates the given semantic element
protected override void Validate(TElement element, RuleApplication ruleApplication, ParseContext context)
Parameters
elementTElementthe element that should be validated
ruleApplicationRuleApplicationthe rule application in the context of which validation is performed
contextParseContextthe context in which validation is performed
ValidateIncrementally(Expression<Func<TElement, string>>, DiagnosticSeverity)
Instructs the rule to validate elements using the given validator method incrementally
protected void ValidateIncrementally(Expression<Func<TElement, string>> validatorExpression, DiagnosticSeverity severity = DiagnosticSeverity.Error)
Parameters
validatorExpressionExpression<Func<TElement, string>>a function to validate elements
severityDiagnosticSeveritythe severity of errors