TX Text Control .NET Server

Instruction 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 Instruction class to determine an action that is executed when the defined requirements of the ConditionalInstruction.Conditions array are fulfilled or not fulfilled.

Syntax

Instruction(FormField, Instruction.InstructionTypes, object)

Initializes a new instance of the Instruction class to determine the executing action when the defined requirements of the ConditionalInstruction.Conditions array are fulfilled. Using this overload, by default, no else instruction is applied when the corresponding conditions are not fulfilled. Accordingly, the Instruction.IsElseInstructionEnabled property is set to false and the Instruction.ElseInstructionValue property value returns the instruction type depending default value.

public Instruction(FormField formField, Instruction.InstructionTypes instructionType, object instructionValue);
ParameterDescription
formField

Specifies the form field to which the specified action is executed.

instructionType

Specifies the type of the action to perfom.

instructionValue

Specifies the desired value that is set by the specified action when the defined requirements of the ConditionalInstruction.Conditions array are fulfilled.

The type of the instructionValue parameter depends on the Instruction.InstructionTypes enumeration value that is specified by the instructionType parameter and, in case Instruction.InstructionTypes.SetValue is set, the related form field type:

instructionType parameter valueinstructionValue parameter type
IsEnabledBoolean
IsValueValidBoolean
SetValue (CheckFormField)Boolean
SetValue (TextFormField)String (null or String.Empty to remove content)
SetValue (SelectionFormField)String (null or String.Empty to remove content)
SetValue (DateFormField)System.DateTime (null to remove content)
SetItems (only SelectionFormField)String[] (null or String[0] to remove items)

Instruction(FormField, Instruction.InstructionTypes, object, object)

Initializes a new instance of the Instruction class to determine the executing actions when the defined requirements of the ConditionalInstruction.Conditions array are fulfilled or not fulfilled. Apart from the instructionValue parameter value, that is set by the specified action when the defined requirements of the ConditionalInstruction.Conditions array are fulfilled, an else instruction value must be specified. It is set if the corresponding condtitions are not fulfilled. On using this overload, the Instruction.IsElseInstructionEnabled property is set to true and the Instruction.ElseInstructionValue property represents the set else instruction value.

public Instruction(FormField formField, Instruction.InstructionTypes instructionType, object instructionValue, object elseInstructionValue);
ParameterDescription
formField

Specifies the form field to which the specified action is executed.

instructionType

Specifies the type of the action to perfom.

instructionValue

Specifies the desired value that is set by the specified action when the defined requirements of the ConditionalInstruction.Conditions array are fulfilled.

The type of the instructionValue parameter depends on the Instruction.InstructionTypes enumeration value that is specified by the instructionType parameter and, in case Instruction.InstructionTypes.SetValue is set, the related form field type:

instructionType parameter valueinstructionValue parameter type
IsEnabledBoolean
IsValueValidBoolean
SetValue (CheckFormField)Boolean
SetValue (TextFormField)String (null or String.Empty to remove content)
SetValue (SelectionFormField)String (null or String.Empty to remove content)
SetValue (DateFormField)System.DateTime (null to remove content)
SetItems (only SelectionFormField)String[] (null or String[0] to remove items)
elseInstructionValue

Specifies the desired value that is set by the specified action when the defined requirements of the ConditionalInstruction.Conditions array are not fulfilled.

The type of the elseInstructionValue parameter depends on the Instruction.InstructionTypes enumeration value that is specified by the instructionType parameter and, in case Instruction.InstructionTypes.SetValue is set, the related form field type:

instructionType parameter valueinstructionValue parameter type
IsEnabledBoolean
IsValueValidBoolean
SetValue (CheckFormField)Boolean
SetValue (TextFormField)String (null or String.Empty to remove content)
SetValue (SelectionFormField)String (null or String.Empty to remove content)
SetValue (DateFormField)System.DateTime (null to remove content)
SetItems (only SelectionFormField)String[] (null or String[0] to remove items)

Examples

The following example creates an Instruction instance and configures its is else instruction enabled setting for a document workflow.

Instruction instruction = new(new TXTextControl.CheckFormField(true), Instruction.InstructionTypes.IsEnabled, "Approved");
instruction.IsElseInstructionEnabled = true;