# DocumentTargetCollection Class

> An instance of the DocumentTargetCollection class contains all targets in a Text Control document represented through objects of the type DocumentTarget. An instance of this class can only be obtained with the TextControl.DocumentTargets property. The DocumentTargetCollection class implements the IEnumerable and the ICollection interface. For more information see the technical article Text Fields and Hypertext Links.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Class
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Implements:** `System.Collections.ICollection`, `System.Collections.IEnumerable`
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > DocumentTargetCollection Class
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/llms-full.txt

---

## On This Page

- [Description](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/#description)
- [Syntax](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/#syntax)
- [Examples](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/#examples)
- [Members](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/#members)

---

## In This Section

- [DocumentTargetCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/add-method/llms.txt): Inserts the specified target at the current text input position.
- [DocumentTargetCollection.CanAdd Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/canadd-property/llms.txt): Gets a value indicating whether a new document target can be inserted at the current text input position. It is true if a target can be inserted, otherwise it is false.
- [DocumentTargetCollection.Clear Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/clear-method/llms.txt): Removes all document targets from a Text Control document.
- [DocumentTargetCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/copyto-method/llms.txt): Copies the elements of the collection to an array, starting at a particular index.
- [DocumentTargetCollection.Count Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/count-property/llms.txt): Gets the number of elements contained in the collection.
- [DocumentTargetCollection.GetEnumerator Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/getenumerator-method/llms.txt): Returns an enumerator that can be used to iterate through the collection.
- [DocumentTargetCollection.GetItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/getitem-method/llms.txt): Gets a particular document target from the collection.
- [DocumentTargetCollection.GetItems Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/getitems-method/llms.txt): Gets all document targets at the current text input position. The method returns null, if there is no target at the current input position.
- [DocumentTargetCollection.IsSynchronized Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/issynchronized-property/llms.txt): Returns true if the collection is designed to be thread safe, otherwise, it returns false.
- [DocumentTargetCollection.Item Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/item-property/llms.txt): Gets the field with the specified number from the collection. The number must be between 1 and Count. In C# this property is the indexer for the DocumentTargetCollection class.
- [DocumentTargetCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/remove-method/llms.txt): Removes the specified target from a Text Control document.
- [DocumentTargetCollection.SyncRoot Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/syncroot-property/llms.txt): Gets an object that can be used to synchronize access to the collection.

---

## Nearby

- **Previous:** [DocumentTarget.TargetName Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttarget/targetname-property/llms.txt)
- **Next:** [DocumentTargetCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/add-method/llms.txt)
