EditableRegionCollection Class
- Namespace
TXTextControl
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. WinForms. SDK
- Assembly
TXTextControl.dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. WinForms. SDK TXTextControl.from the setup.dll
- Implements
- ICollection, IEnumerable
Description
Contains all editable regions in the main text or another part of a document. It is a collection of objects of the type EditableRegion. A collection object can be obtained with the TextControl.EditableRegions, the HeaderFooter.EditableRegions or the TextFrame.EditableRegions property. The EditableRegionCollection class implements the IEnumerable and the ICollection interfaces. When the EditMode property of a Text Control has been set to ReadAndSelect, editable regions can still be edited, either by everyone or depending on the UserName property by a certain user.
Syntax
public sealed class EditableRegionCollection : ICollection, IEnumerablePublic NotInheritable Class EditableRegionCollection
Implements ICollection, IEnumerableExamples
The following example works with editable regions in the current document.
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
EditableRegionCollection editableRegionCollection = textControl.EditableRegions;
editableRegionCollection.Add(new EditableRegion("ReviewTeam", 100));textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim editableRegionCollection As EditableRegionCollection = textControl.EditableRegions
editableRegionCollection.Add(New EditableRegion("ReviewTeam", 100))Members
Properties
| Property | Description |
|---|---|
| Count | Gets the number of elements contained in the collection. |
| IsSynchronized | Returns true if the collection is designed to be thread safe, otherwise, it returns false. |
| Item | Gets the editable region with the specified number from the collection. The number must be between 1 and Count. In C# this property is the indexer for the EditableRegionCollection class. |
| SyncRoot | Gets an object that can be used to synchronize access to the collection. |
Methods
| Method | Description |
|---|---|
| Add | Adds a new editable region to the document. Its position is defined through the EditableRegion.Start and EditableRegion.Length properties. If the editable region's length is zero, the current text selection is used to define the position. |
| CopyTo | Copies the elements of the collection to an array, starting at a particular index. |
| GetEnumerator | Returns an enumerator that can be used to iterate through the collection. |
| GetItem | Gets the editable region with the specified id. The method returns null, if such a region does not exist. If more than one region with this id exists, the first found region is returned. |
| GetItems | Gets all editable regions at the current text input position. The method returns null, if there is no region at the current input position. |
| Remove | Removes an editable region from the collection. The region's text is not removed. |
Enumerations
| Enumeration | Description |
|---|---|
| AddResult | Specifies the result when an editable region has been added to the document. |