TX Text Control .NET for WPF

FieldAdapter Class

Class|Introduced in 15.0
Namespace
TXTextControl.DocumentServer.Fields
Package
TXTextControl.TextControl.WPF.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXDocumentServer.dll
Install
dotnet add package TXTextControl.TextControl.WPF.SDK .NET 8 and later. For .NET Framework, reference TXDocumentServer.dll from the setup.
Derived
ContentControlFieldAdapter, FormFieldAdapter, MailMergeFieldAdapter

Description

The abstract FieldAdapter class is the base class of all special DocumentServer field adapters. It implements general features like the adapted ApplicationField or the specific TypeName. These special fields can be only used in combination with the ApplicationField class.

Syntax

public abstract class FieldAdapter

Examples

The following example includes the application field value from a Field Adapter object in application diagnostics. The created object is then available to the surrounding document workflow.

Console.WriteLine($"Application Field: {fieldAdapter.ApplicationField}");
Console.WriteLine("Field Adapter is ready for use.");

Members

Constructors

ConstructorDescription
FieldAdapterInitializes a new instance of the FieldAdapter class.

Properties

PropertyDescription
ApplicationFieldGets the adapted ApplicationField of the field. Each special field acts like an adapter for the specific ApplicationField.
IDGets the ID of the specific field through its adapter.
LengthGets the number of characters in a text field through its adapter.
StartGets the first character position (one-based) of the field through its adapter.
TypeNameGets the field's type name of the specific field through its adapter. For example for the type name of a Microsoft Word MergeField is MERGEFIELD. If the type name of the field is changed, its parameters must also be changed.

Methods

MethodDescription
ShowDialogOpens the specific field options dialog box.

Fields

FieldDescription
TYPE_NAMERepresents the name of the respective field type. Every subclass of FieldAdapter overwrites this with its respective type name.