TX Text Control .NET for Windows Forms

IfField Class

Class|Introduced in 15.0
Namespace
TXTextControl.DocumentServer.Fields
Package
TXTextControl.TextControl.WinForms.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXDocumentServer.dll
Install
dotnet add package TXTextControl.TextControl.WinForms.SDK .NET 8 and later. For .NET Framework, reference TXDocumentServer.dll from the setup.
Inherits
  1. FieldAdapter
  2. MailMergeFieldAdapter
  3. IfField

Description

The IfField class implements the MS Word specific IF field. This field must be used in combination with an ApplicationField that should be modified using this adapter.

Syntax

public sealed class IfField : MailMergeFieldAdapter

Examples

The following example creates an If Field instance and configures its text setting for a document workflow.

TXTextControl.DocumentServer.Fields.IfField ifField = new();
ifField.Text = "Quarterly results";

Members

Constructors

ConstructorDescription
IfFieldInitializes a new instance of the IfField class.
MailMergeFieldAdapterInitializes a new instance of the MailMergeFieldAdapter class. (Inherited from MailMergeFieldAdapter.)

Properties

PropertyDescription
DataSourceCultureSpecifies the culture which is used for the relational comparison of numerical values. The default value for this property is the current thread culture.
Expression1Gets and sets the first expression text that should be compared. To use this field in the MailMerge component, this property must be a valid field name.
Expression2Gets and sets the second expression text that should be compared to Expression1.
FalseTextGets and sets the text that should be displayed when the comparison is false.
FieldValueGets or sets the field's value of the field that has been specified in Expression1.
MergeCultureSpecifies the culture with which numerical and date / time values are formatted when merged into the target document. The default value for this property is the current thread culture.
OperatorGets and sets the operator of the field.
PreserveFormattingSpecifies whether the field's formatting should be preserved. (Inherited from MailMergeFieldAdapter.)
TextGets and sets the displayed text of the field.
TrueTextGets and sets the text that should be displayed when the comparison is true.

Fields

FieldDescription
TYPE_NAMENot described in the reference. public const string TYPE_NAME = "IF";