Class
FindExpression<T>

Holds the definition of a Find Expression.

Definition

Namespace:ArtOfTest.Common

Assembly:ArtOfTest.WebAii.dll

Type Parameters:

T

A FindClause.

Syntax:

cs-api-definition
[DataContract(Namespace = "http://artoftest.com/schemas/WebAiiDesignCanvas/2.0.0")]
public abstract class FindExpression<T> : IFindExpression where T : FindClause

Inheritance: objectFindExpression<T>

Derived Classes: DummyFindExpressionHtmlFindExpressionDesktopFindExpressionXamlFindExpression

Implements: IFindExpression

Constructors

FindExpression()

Create an empty expression.

Declaration

cs-api-definition
public FindExpression()

FindExpression(params string[])

Create a new FindExpression.

Declaration

cs-api-definition
public FindExpression(params string[] findClauses)

Parameters

findClauses

string[]

A string array of find clauses.

Properties

ChainStops

Gets the list of chain locations in the clauses.

Declaration

cs-api-definition
[DataMember(Name = "ChainStops")]
public IList<int> ChainStops { get; }

Property Value

IList<int>

Implements IFindExpression.ChainStops

Clauses

Gets the expression clauses

Declaration

cs-api-definition
public string[] Clauses { get; }

Property Value

string[]

Implements IFindExpression.Clauses

Constraints

Get any hierarchy constraints.

Declaration

cs-api-definition
[DataMember(Name = "Constraints")]
public IList<HierarchyConstraint> Constraints { get; }

Property Value

IList<HierarchyConstraint>

Implements IFindExpression.Constraints

FindClauses

Gets or sets the find statement.

Declaration

cs-api-definition
[DataMember(Name = "Clauses")]
public IList<T> FindClauses { get; }

Property Value

IList<T>

HasConstraints

Gets whether this expression have hierarchy constraints

Declaration

cs-api-definition
public bool HasConstraints { get; }

Property Value

bool

HasHierarchicalDependency

Gets whether this expression has any hierarchal dependencies.

Declaration

cs-api-definition
public bool HasHierarchicalDependency { get; }

Property Value

bool

Implements IFindExpression.HasHierarchicalDependency

IsChained

Gets whether the search is chained.

Declaration

cs-api-definition
public bool IsChained { get; }

Property Value

bool

Implements IFindExpression.IsChained

StringRepresentation

Get the string representation of this expression.

Declaration

cs-api-definition
public string StringRepresentation { get; }

Property Value

string

Implements IFindExpression.StringRepresentation

SupportedSearchType

Gets the supported search type as a Type object.

Declaration

cs-api-definition
public abstract Type SupportedSearchType { get; }

Property Value

Type

Implements IFindExpression.SupportedSearchType

Methods

AddClause(string)

Add the clause to the collection.

Declaration

cs-api-definition
public abstract void AddClause(string clause)

Parameters

clause

string

The clause to add.

AddHierarchyConstraint(HierarchyConstraint)

Add a hierarchy constraint.

Declaration

cs-api-definition
public virtual void AddHierarchyConstraint(HierarchyConstraint constraint)

Parameters

constraint

HierarchyConstraint

The constraint to add

AppendChain(IFindExpression)

Append the passed in expression as a chain to the end of the expression.

Declaration

cs-api-definition
public void AppendChain(IFindExpression expression)

Parameters

expression

IFindExpression

The expression to append.

Implements IFindExpression.AppendChain(IFindExpression)

AppendClauses(bool, params string[])

Append a set of clauses

Declaration

cs-api-definition
public void AppendClauses(bool asChain, params string[] clausesToAppend)

Parameters

asChain

bool

Whether to append as a chain or simply to the end of the expression

clausesToAppend

string[]

The clauses to append.

Implements IFindExpression.AppendClauses(bool, params string[])

CheckConstraints(ITargetElement)

Check the constraints of this target.

Declaration

cs-api-definition
public virtual bool CheckConstraints(ITargetElement target)

Parameters

target

ITargetElement

Returns

bool

GetClauses(int)

Get the list of clauses

Declaration

cs-api-definition
public IList<FindClause> GetClauses(int chainIndex)

Parameters

chainIndex

int

Returns

IList<FindClause>

Implements IFindExpression.GetClauses(int)

Initialize(string[])

Initialize this expression with a set of clauses.

Declaration

cs-api-definition
public virtual void Initialize(string[] clauses)

Parameters

clauses

string[]

The clauses to use.

Implements IFindExpression.Initialize(string[])

Match(ITargetElement)

Match this expression against a target.

Declaration

cs-api-definition
public virtual bool Match(ITargetElement target)

Parameters

target

ITargetElement

The target to match

Returns

bool

True/False is this target matches

Implements IFindExpression.Match(ITargetElement)

Remarks

This call with throw an ArgumentException if the expression has a hierarchical dependency.

Match(ITargetElement, IList<FindClause>, bool)

Match a set of clauses against a target.

Declaration

cs-api-definition
public virtual bool Match(ITargetElement target, IList<FindClause> clauses, bool ignoreConstraints)

Parameters

target

ITargetElement

The target element to match.

clauses

IList<FindClause>

The list of clauses to use during the match test.

ignoreConstraints

bool

Whether or not to ignore any contraints contained in the clauses.

Returns

bool

Implements IFindExpression.Match(ITargetElement, IList<FindClause>, bool)

Match(ITargetElement, IList<FindClause>, bool, ITargetElement)

Match a specific set of clauses.

Declaration

cs-api-definition
public virtual bool Match(ITargetElement target, IList<FindClause> clauses, bool ignoreConstraints, ITargetElement root)

Parameters

target

ITargetElement

The target element to match.

clauses

IList<FindClause>

A list of clauses to test for a match.

ignoreConstraints

bool

Whether or not to ignore any constraints attached to the clauses.

root

ITargetElement

Root element of search tree.

Returns

bool

Implements IFindExpression.Match(ITargetElement, IList<FindClause>, bool, ITargetElement)

ToString()

Returns the string representation of this FindExpression.

Declaration

cs-api-definition
public override string ToString()

Returns

string

The string.

Overrides object.ToString()

Update(string[])

Update this expression with the new expression

Declaration

cs-api-definition
public void Update(string[] expression)

Parameters

expression

string[]

Implements IFindExpression.Update(string[])