# DocumentController.FieldAdapterCollection.GetEnumerator Method

> Returns an enumerator that can be used to iterate over the collection's items.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 15.0
- **Namespace:** `TXTextControl.DocumentServer`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.DocumentServer > DocumentController.FieldAdapterCollection.GetEnumerator Method
- **467 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver/documentcontroller-fieldadaptercollection/getenumerator-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver/documentcontroller-fieldadaptercollection/getenumerator-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver/documentcontroller-fieldadaptercollection/getenumerator-method/llms-full.txt

---

### Description

Returns an enumerator that can be used to iterate over the collection's items.

### Syntax

```csharp
public IEnumerator GetEnumerator();
```

```vbnet
Public Function GetEnumerator() As IEnumerator
```

### Return Value

The return value is an IEnumerator that represents the collection.

### Examples

The following example obtains an enumerator and visits each field adapter in the collection.

```csharp
IEnumerator enumerator = fieldAdapterCollection.GetEnumerator();

while (enumerator.MoveNext())
{
    TXTextControl.DocumentServer.Fields.FieldAdapter fieldAdapter = (TXTextControl.DocumentServer.Fields.FieldAdapter)enumerator.Current;
    Console.WriteLine(fieldAdapter);
}
```

```vbnet
Dim enumerator As IEnumerator = fieldAdapterCollection.GetEnumerator()

While enumerator.MoveNext()
    Dim fieldAdapter As TXTextControl.DocumentServer.Fields.FieldAdapter =
        DirectCast(enumerator.Current, TXTextControl.DocumentServer.Fields.FieldAdapter)
    Console.WriteLine(fieldAdapter)
End While
```

---

## Nearby

- **Previous:** [DocumentController.FieldAdapterCollection.Count Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver/documentcontroller-fieldadaptercollection/count-property/llms-full.txt)
- **Next:** [DocumentController.FieldAdapterCollection.IndexOf Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver/documentcontroller-fieldadaptercollection/indexof-method/llms-full.txt)
