# OpcDataEnumerator&lt;T&gt; Members

> Reference: Provides an enumerator for simple iteration over a generic collection.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcDataEnumerator&lt;T&gt;</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
</dl>

## Constructors

### OpcDataEnumerator

Initializes a new instance of the [OpcDataEnumerator&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdataenumerator-1/) class using the `list` as the orginator of the items to iterate.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcDataEnumerator(IList<T> list)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub New(list As IList(Of T))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `list` | [IList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1)&lt;T&gt; | An instance implementing the [IList&lt;T&gt;](https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1) interface its items are enumerated by the new [OpcDataEnumerator&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdataenumerator-1/). |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `list` is a null reference (Nothing in Visual Basic). |

## Properties

### Current

Gets the element in the origin at the current position of the enumerator.

<div class="api-signature" data-lang="csharp">

```csharp
public T Current { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Current As T
```

</div>

**Property value**

T

The element in the origin at the current position of the enumerator.

**Exceptions**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The enumerator has not yet been moved. |

**Implements**

[Current](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1.current)

## Methods

### Dispose

<span class="api-meta">2 overloads</span>

| Overload | Description |
|---|---|
| [Dispose()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdataenumerator-1/members#dispose-noparams) | Releases all resources used by the [OpcDataEnumerator&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdataenumerator-1/). |
| [Dispose(bool)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdataenumerator-1/members#dispose-system-boolean)<span class="api-meta">protected · virtual</span> | Releases the unmanaged resources used by the [OpcDataEnumerator&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdataenumerator-1/) and optionally releases the managed resources. |

#### Dispose()

Releases all resources used by the [OpcDataEnumerator&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdataenumerator-1/).

<div class="api-signature" data-lang="csharp">

```csharp
public void Dispose()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub Dispose()
```

</div>

**Implements**

[Dispose()](https://learn.microsoft.com/dotnet/api/system.idisposable.dispose)

#### Dispose(bool)

<span class="api-meta">protected · virtual</span>

Releases the unmanaged resources used by the [OpcDataEnumerator&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdataenumerator-1/) and optionally releases the managed resources.

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void Dispose(bool disposing)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub Dispose(disposing As Boolean)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `disposing` | [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) | The value true to release both managed and unmanaged resources; otherwise the value false to release only unmanaged resources. |

### MoveNext

Advances the enumerator to the next element of the origin.

<div class="api-signature" data-lang="csharp">

```csharp
public bool MoveNext()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function MoveNext() As Boolean
```

</div>

**Returns**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the enumerator was successfully advanced to the next element; otherwise the value false if the enumerator has passed the end of the origin.

**Implements**

[MoveNext()](https://learn.microsoft.com/dotnet/api/system.collections.ienumerator.movenext)

### Reset

Sets the enumerator to its initial position, which is before the first element in the origin.

<div class="api-signature" data-lang="csharp">

```csharp
public void Reset()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub Reset()
```

</div>

**Implements**

[Reset()](https://learn.microsoft.com/dotnet/api/system.collections.ienumerator.reset)
