ClassHierarchyConstraint
A Hierarchy constraint can be used to constraint the FindExpression match to a specific hierarchy setup.
Definition
Namespace:ArtOfTest.Common
Assembly:ArtOfTest.WebAii.dll
Syntax:
[DataContract(Namespace = "http://artoftest.com/schemas/WebAiiDesignCanvas/2.0.0")]
public class HierarchyConstraint
Inheritance: objectHierarchyConstraint
Constructors
HierarchyConstraint(IFindExpression, params int[])
Create a new hierarchy constraint.
Declaration
public HierarchyConstraint(IFindExpression expression, params int[] pathReference)
Parameters
expression
The expression to use.
pathReference
int[]
The path reference string example "1,3,2". Negative values refer to parent nodes, positive values refer to child nodes. For example: The first child of a parent can be expressed as "-1,1".
Remarks
Indexes are 1 based given that a zero can't be positive or negative.
HierarchyConstraint(IFindExpression, string)
Create a new hierarchy constraint.
Declaration
public HierarchyConstraint(IFindExpression expression, string pathReference)
Parameters
expression
The expression to use.
pathReference
The path reference string example "1,3,2". Negative values refer to parent nodes, positive values refer to child nodes. For example: The first child of a parent can be expressed as "-1,1".
Remarks
Indexes are 1 based given that a zero can't be positive or negative.
Fields
PathSeparator
Path separator used in the PathReference.
Properties
Expression
Get the Find Expression.
Declaration
public IFindExpression Expression { get; }
Property Value
Methods
Validate(ITargetElement)
Validate this constraint against a target element.
Declaration
public bool Validate(ITargetElement target)
Parameters
target
The target element.
Returns
True/False whether this constraint validates against this element.