Class ValidationRule
Represents a Validation
Implements
Inherited Members
Namespace: TimeCockpit.Data.DataModel
Assembly: TimeCockpit.Data.dll
Syntax
public class ValidationRule : ModelElement, IDynamicMetaObjectProvider, INotifyPropertyChanged, IDataErrorInfo
Constructors
ValidationRule()
Initializes a new instance of the ValidationRule class
Declaration
public ValidationRule()
ValidationRule(IEnumerable<KeyValuePair<Object, Object>>)
Initializes a new instance of the ValidationRule class.
Declaration
public ValidationRule(IEnumerable<KeyValuePair<object, object>> properties)
Parameters
Type | Name | Description |
---|---|---|
System. |
properties | Collection of properties. |
ValidationRule(ValidationRule)
Initializes a new instance of the Validation
Declaration
public ValidationRule(ValidationRule element)
Parameters
Type | Name | Description |
---|---|---|
Validation |
element | The element. |
Properties
Condition
Gets or sets the condition of of the Validation
Declaration
public string Condition { get; set; }
Property Value
Type | Description |
---|---|
System. |
Function
Gets the CLR function for the calculated property
Declaration
public Func<EntityObject, object> Function { get; }
Property Value
Type | Description |
---|---|
System. |
Remarks
The function needs the Entity
IsDisabled
Gets or sets a value indicating whether the validation rule is disalbed or not.
Declaration
public bool IsDisabled { get; set; }
Property Value
Type | Description |
---|---|
System. |
|
Message
Gets or sets the message that should be issued if the validation fails
Declaration
public string Message { get; set; }
Property Value
Type | Description |
---|---|
System. |
Perpetrator
Gets or sets the name of the propery that is responsible for the failing validation
Declaration
public string Perpetrator { get; set; }
Property Value
Type | Description |
---|---|
System. |
Methods
Accept(ModelElementVisitor)
accepts a visitor. Dispatches the visit handler method for a Validation
Declaration
public override void Accept(ModelElementVisitor visitor)
Parameters
Type | Name | Description |
---|---|---|
Model |
visitor | the visitor to dispatch to. |
Overrides
GetParticipatingMembers()
Gets the participating members of the of validation condition.
Declaration
public IEnumerable<string> GetParticipatingMembers()
Returns
Type | Description |
---|---|
System. |
Returns the enumeration of participating members. |
Validate(ref IList<PropertyValidationMessage>, Boolean)
Validates a Model
Declaration
protected override void Validate(ref IList<PropertyValidationMessage> messages, bool validateRecursively)
Parameters
Type | Name | Description |
---|---|---|
System. |
messages | An list of strings that stores that picks up the validation errors of a model element. |
System. |
validateRecursively | Indicates wheter to validate only the current model element or all its children (recursively) as well. |
Overrides
Remarks
The rules the Model
When Validate(ref IList<PropertyValidationMessage>, Boolean) is called on a modelelement, the Validate(ref IList<PropertyValidationMessage>, Boolean) method of all children attatched to the modelelemnt are validated recursivly.