TX Text Control .NET Server

Condition Constructor

Constructor|Introduced in 28.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

Description

Initializes a new instance of the Condition class.

Syntax

Condition(CheckFormField, bool)

Creates an instance of the Condition class that tests whether the CheckFormField's Checked property value equals the specified boolean value. The Condition.ComparisonValueType property is set to ComparisonValueTypes.CheckState.

public Condition(CheckFormField formField, bool isChecked);
ParameterDescription
formField

Specifies the form field whose property value is to be compared with the condition's comparison value.

isChecked

Specifies the value that the CheckFormField.Checked property must have to fulfill the condition.

Condition(TextFormField, Condition.ComparisonOperators, string)

Creates an instance of the Condition class that compares the TextFormField's Text property with the specified string value. If that value is null or an empty string, the condition's comparison value is interpreted as ComparisonValueTypes.NoValue. Otherwise as ComparisonValueTypes.CustomText.

public Condition(TextFormField formField, Condition.ComparisonOperators comparisonOperator, string comparisonValue);
ParameterDescription
formField

Specifies the form field whose property value is to be compared with the condition's comparison value.

comparisonOperator

Specifies the operator that is used to compare the condition's form field value with the specified comparison value.

comparisonValue

Specifies the value that is compared with the condition's form field value.

Condition(TextFormField, Condition.ComparisonOperators, string, Condition.TextComparisonFlags)

Creates an instance of the Condition class that compares the TextFormField's Text property with the specified string value. The textComparisonFlag parameter determines whether the comparison value is interpreted as ComparisonValueTypes.CustomText or ComparisonValueTypes.Regex. If the comparisonValue parameter is null or an empty string, a System.ArgumentException is thrown.

public Condition(TextFormField formField, Condition.ComparisonOperators comparisonOperator, string comparisonValue, Condition.TextComparisonFlags textComparisonFlag);
ParameterDescription
formField

Specifies the form field whose property value is to be compared with the condition's comparison value.

comparisonOperator

Specifies the operator that is used to compare the condition's form field value with the specified comparison value.

comparisonValue

Specifies the value that is compared with the condition's form field value.

textComparisonFlag

Determines whether the comparison value is interpreted as ComparisonValueTypes.CustomText or ComparisonValueTypes.Regex.

Condition(SelectionFormField, Condition.ComparisonOperators, string)

Creates an instance of the Condition class that compares the SelectionFormField's Text property with the specified string value. If that value is null or an empty string, the condition's comparison value is interpreted as ComparisonValueTypes.NoValue.

public Condition(SelectionFormField formField, Condition.ComparisonOperators comparisonOperator, string comparisonValue);
ParameterDescription
formField

Specifies the form field whose property value is to be compared with the condition's comparison value.

comparisonOperator

Specifies the operator that is used to compare the condition's form field value with the specified comparison value.

comparisonValue

Specifies the value that is compared with the condition's form field value.

Condition(SelectionFormField, Condition.ComparisonOperators, string, Condition.TextComparisonFlags)

Creates an instance of the Condition class that compares the SelectionFormField's Text property with the specified string value. The textComparisonFlag parameter determines whether the comparison value is interpreted as ComparisonValueTypes.CustomText or ComparisonValueTypes.Regex. If the comparisonValue parameter is null or an empty string, a System.ArgumentException is thrown.

public Condition(SelectionFormField formField, Condition.ComparisonOperators comparisonOperator, string comparisonValue, Condition.TextComparisonFlags textComparisonFlag);
ParameterDescription
formField

Specifies the form field whose property value is to be compared with the condition's comparison value.

comparisonOperator

Specifies the operator that is used to compare the condition's form field value with the specified comparison value.

comparisonValue

Specifies the value that is compared with the condition's form field value.

textComparisonFlag

Determines whether the comparison value is interpreted as ComparisonValueTypes.CustomText or ComparisonValueTypes.Regex.

Condition(SelectionFormField, Condition.ComparisonOperators, string, Condition.ItemComparisonFlags)

Creates an instance of the Condition class that compares the SelectionFormField's Text property with the specified string value. The itemComparisonFlag parameter determines whether the comparison value is interpreted as ComparisonValueTypes.AnyItem or ComparisonValueTypes.SpecificItem. If the itemComparisonFlag parameter is set to ItemComparisonFlags.SpecificItem and the comparisonValue parameter is null, an empty string or not an element of the SelectionFormField.Items collection, a System.ArgumentException is thrown.

public Condition(SelectionFormField formField, Condition.ComparisonOperators comparisonOperator, string comparisonValue, Condition.ItemComparisonFlags itemComparisonFlag);
ParameterDescription
formField

Specifies the form field whose property value is to be compared with the condition's comparison value.

comparisonOperator

Specifies the operator that is used to compare the condition's form field value with the specified comparison value.

comparisonValue

Specifies the value that is compared with the condition's form field value.

itemComparisonFlag

Determines whether the comparison value is interpreted as ComparisonValueTypes.AnyItem or ComparisonValueTypes.SpecificItem.

Condition(DateFormField, Condition.ComparisonOperators, DateTime?)

Creates an instance of the Condition class that compares the DateFormField's Date property with the specified System.DateTime value. If that value is null, the condition's comparison value is interpreted as ComparisonValueTypes.NoValue. Otherwise as ComparisonValueTypes.Date.

public Condition(DateFormField formField, Condition.ComparisonOperators comparisonOperator, DateTime? comparisonValue);
ParameterDescription
formField

Specifies the form field whose property value is to be compared with the condition's comparison value.

comparisonOperator

Specifies the operator that is used to compare the condition's form field value with the specified comparison value.

comparisonValue

Specifies the value that is compared with the condition's form field value.

Condition(DateFormField, Condition.ComparisonOperators, int)

Creates an instance of the Condition class that compares the DateFormField's Date property with the specified integer value. If that value is greater than 1600 and less than 10000, the condition's comparison value is interpreted as ComparisonValueTypes.Year. If the value is a positive number between 1 and 31, the comparison value is interpreted as ComparisonValueTypes.DayOfMonth. For all other integer values a System.ArgumentException is thrown.

public Condition(DateFormField formField, Condition.ComparisonOperators comparisonOperator, int comparisonValue);
ParameterDescription
formField

Specifies the form field whose property value is to be compared with the condition's comparison value.

comparisonOperator

Specifies the operator that is used to compare the condition's form field value with the specified comparison value.

comparisonValue

Specifies the value that is compared with the condition's form field value.

Condition(DateFormField, Condition.ComparisonOperators, Condition.Month)

Creates an instance of the Condition class that compares the DateFormField's Date property with the specified Condition.Month value. That condition's comparison value is interpreted as ComparisonValueTypes.Month.

public Condition(DateFormField formField, Condition.ComparisonOperators comparisonOperator, Condition.Month comparisonValue);
ParameterDescription
formField

Specifies the form field whose property value is to be compared with the condition's comparison value.

comparisonOperator

Specifies the operator that is used to compare the condition's form field value with the specified comparison value.

comparisonValue

Specifies the value that is compared with the condition's form field value.

Condition(DateFormField, Condition.ComparisonOperators, DayOfWeek)

Creates an instance of the Condition class that compares the DateFormField's Date property with the specified System.DayOfWeek value. That condition's comparison value is interpreted as ComparisonValueTypes.Weekday.

public Condition(DateFormField formField, Condition.ComparisonOperators comparisonOperator, DayOfWeek comparisonValue);
ParameterDescription
formField

Specifies the form field whose property value is to be compared with the condition's comparison value.

comparisonOperator

Specifies the operator that is used to compare the condition's form field value with the specified comparison value.

comparisonValue

Specifies the value that is compared with the condition's form field value.

Examples

The following example creates a Condition instance and configures its logical connective setting for a document workflow.

Condition condition = new(new TXTextControl.CheckFormField(true), true);
condition.LogicalConnective = Condition.LogicalConnectives.And;