Class
HierarchyConstraint

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:

cs-api-definition
[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

cs-api-definition
public HierarchyConstraint(IFindExpression expression, params int[] pathReference)

Parameters

expression

IFindExpression

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

cs-api-definition
public HierarchyConstraint(IFindExpression expression, string pathReference)

Parameters

expression

IFindExpression

The expression to use.

pathReference

string

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.

Declaration

cs-api-definition
public const char PathSeparator = ','

Field Value

char

Properties

Expression

Get the Find Expression.

Declaration

cs-api-definition
public IFindExpression Expression { get; }

Property Value

IFindExpression

Methods

Validate(ITargetElement)

Validate this constraint against a target element.

Declaration

cs-api-definition
public bool Validate(ITargetElement target)

Parameters

target

ITargetElement

The target element.

Returns

bool

True/False whether this constraint validates against this element.