TX Text Control .NET Server

EditableRegion Constructor

Constructor|Introduced in 25.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 EditableRegion class.

Syntax

EditableRegion(string, int)

Creates an editable region with the specified user name and/or id. The start and length of the editable region are initialized to zero. When a zero-length editable region is inserted, the current text selection defines it position and length.

public EditableRegion(string userName, int id);
ParameterDescription
userName

Specifies the name of the user who can edit the region. This parameter can be null or an empty string to indicate, that no user name has been specified and the region can be edited by everyone.

id

Specifies an identifier for the editable region. This parameter can be 0 to indicate, that the editable region has no identifier.

EditableRegion(string, int, int, int)

Creates an editable region with the specified user name, id, start position and length.

public EditableRegion(string userName, int id, int start, int length);
ParameterDescription
userName

Specifies the name of the user who can edit the region. This parameter can be null or an empty string to indicate, that no user name has been specified and the region can be edited by everyone.

id

Specifies an identifier for the editable region. This parameter can be 0 to indicate, that the editable region has no identifier.

start

Specifies the index (one-based) of the first character which belongs to the editable region.

length

Specifies the number of characters which belong to the editable region.

Examples

The following example marks selected contract text as editable by the review team.

textControl.Text = "Terms subject to legal review";
textControl.Select(0, textControl.Text.Length);
EditableRegion editableRegion = new("ReviewTeam", 10);
textControl.EditableRegions.Add(editableRegion);