Search Results for

    Show / Hide Table of Contents

    Class ValidationRule

    Represents a ValidationRule which can be applied to a ModelEntityBase

    Inheritance
    System.Object
    DynamicObject
    NamedDynamicObject
    ModelElement
    ValidationRule
    Implements
    System.Dynamic.IDynamicMetaObjectProvider
    System.ComponentModel.INotifyPropertyChanged
    System.ComponentModel.IDataErrorInfo
    Inherited Members
    ModelElement.IsValidIdentifier(String)
    ModelElement.OnDeserializing(StreamingContext)
    ModelElement.Attach(ModelElement)
    ModelElement.Detach()
    ModelElement.SetOwnershipPrefix(String)
    ModelElement.UpdateChildren(NotifyCollectionChangedEventArgs)
    ModelElement.SetPersistBehavior(PersistBehavior)
    ModelElement.SetName(String)
    ModelElement.SetOwnership(Ownership)
    ModelElement.ElementGuid
    ModelElement.Name
    ModelElement.Parent
    ModelElement.Children
    ModelElement.PersistBehavior
    ModelElement.IsFullPersistBehavior
    ModelElement.IsNonePersistBehavior
    ModelElement.IsSystemElement
    ModelElement.IsApplicationSpecificElement
    ModelElement.IsUserElement
    ModelElement.IsSystemOrApplicationSpecificElement
    ModelElement.InvariantFriendlyName
    ModelElement.CreationVersion
    ModelElement.LastUpdateVersion
    ModelElement.Error
    ModelElement.ErrorSummary
    ModelElement.IsValid
    ModelElement.Ownership
    ModelElement.OwnershipPrefix
    ModelElement.NonPrefixedName
    NamedDynamicObject.OnPropertyChanged(String)
    NamedDynamicObject.PropertyChanged
    DynamicObject.GetMember(String)
    DynamicObject.SetMember(String, Object)
    DynamicObject.GetMetaObject(Expression)
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    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.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Object, System.Object>> properties

    Collection of properties.

    ValidationRule(ValidationRule)

    Initializes a new instance of the ValidationRule class.

    Declaration
    public ValidationRule(ValidationRule element)
    Parameters
    Type Name Description
    ValidationRule element

    The element.

    Properties

    Condition

    Gets or sets the condition of of the ValidationRule

    Declaration
    public string Condition { get; set; }
    Property Value
    Type Description
    System.String

    Function

    Gets the CLR function for the calculated property

    Declaration
    public Func<EntityObject, object> Function { get; }
    Property Value
    Type Description
    System.Func<EntityObject, System.Object>
    Remarks

    The function needs the EntityObject on which it should operate as the first parameter.

    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.Boolean

    true if this instance is disalbed; otherwise, false.

    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.String

    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.String

    Methods

    Accept(ModelElementVisitor)

    accepts a visitor. Dispatches the visit handler method for a ValidationRule

    Declaration
    public override void Accept(ModelElementVisitor visitor)
    Parameters
    Type Name Description
    ModelElementVisitor visitor

    the visitor to dispatch to.

    Overrides
    ModelElement.Accept(ModelElementVisitor)

    GetParticipatingMembers()

    Gets the participating members of the of validation condition.

    Declaration
    public IEnumerable<string> GetParticipatingMembers()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.String>

    Returns the enumeration of participating members.

    Validate(ref IList<PropertyValidationMessage>, Boolean)

    Validates a ModelElement according to certain rules.

    Declaration
    protected override void Validate(ref IList<PropertyValidationMessage> messages, bool validateRecursively)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<PropertyValidationMessage> messages

    An list of strings that stores that picks up the validation errors of a model element.

    System.Boolean validateRecursively

    Indicates wheter to validate only the current model element or all its children (recursively) as well.

    Overrides
    ModelElement.Validate(ref IList<PropertyValidationMessage>, Boolean)
    Remarks

    The rules the ModelElement is validated against are dependent on the type of ModelElement that is validated. This method can be overridden to provide custom validation behavior for subclasses of ModelElement

    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.

    In This Article
    Back to top Copyright © 2020 software architects gmbh