# OpcNodeIdCollection Members

> Reference: Represents a collection of OpcNodeId instances.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcNodeIdCollection</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>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

Inherits members from [Collection&lt;OpcNodeId&gt;](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.collection-1).

## Constructors

### OpcNodeIdCollection

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

| Overload | Description |
|---|---|
| [OpcNodeIdCollection()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeidcollection/members#opcnodeidcollection-noparams) | Initializes a new instance of the [OpcNodeIdCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeidcollection/) class. |
| [OpcNodeIdCollection(IList&lt;OpcNodeId&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeidcollection/members#opcnodeidcollection-system-collections-generic-ilist-of-opc-uafx-opcnodeid) | Initializes a new instance of the [OpcNodeIdCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeidcollection/) class as a wrapper for the specified `list`. |

#### OpcNodeIdCollection()

Initializes a new instance of the [OpcNodeIdCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeidcollection/) class.

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

```csharp
public OpcNodeIdCollection()
```

</div>

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

```vbnet
Public Sub New()
```

</div>

#### OpcNodeIdCollection(IList&lt;OpcNodeId&gt;)

Initializes a new instance of the [OpcNodeIdCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeidcollection/) class as a wrapper for the specified `list`.

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

```csharp
public OpcNodeIdCollection(IList<OpcNodeId> list)
```

</div>

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

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

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `list` | [IList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1)&lt;[OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/)&gt; | The [IList&lt;T&gt;](https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1) of [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) values to wrap. |

**Exceptions**

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

## Methods

### ClearItems

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

Removes all elements from the collection.

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

```csharp
protected override void ClearItems()
```

</div>

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

```vbnet
Protected Overrides Sub ClearItems()
```

</div>

**Overrides**

[ClearItems()](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.collection-1.clearitems)

### InsertItem

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

Inserts the `item` into the collection at the `index` specified.

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

```csharp
protected override void InsertItem(int index, OpcNodeId item)
```

</div>

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

```vbnet
Protected Overrides Sub InsertItem(index As Integer, item As OpcNodeId)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `index` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The zero-based index at which the `item` is to be inserted. |
| `item` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) to insert. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception) | The `index` is less than zero or greater than the number of elements in the collection. |

**Overrides**

[InsertItem(int, OpcNodeId)](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.collection-1.insertitem)

### RemoveItem

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

Removes the element at the `index` specified from the collection.

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

```csharp
protected override void RemoveItem(int index)
```

</div>

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

```vbnet
Protected Overrides Sub RemoveItem(index As Integer)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `index` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The zero-based index of the element to remove. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception) | The `index` is less than zero or equal to or greater than the number of elements in the collection. |

**Overrides**

[RemoveItem(int)](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.collection-1.removeitem)

### SetItem

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

Replaces the element at the `index` specified with the `item`.

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

```csharp
protected override void SetItem(int index, OpcNodeId item)
```

</div>

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

```vbnet
Protected Overrides Sub SetItem(index As Integer, item As OpcNodeId)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `index` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The zero-based index of the element to replace. |
| `item` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The new [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) at the `index`. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception) | The `index` is less than zero or equal to or greater than the number of elements in the collection. |

**Overrides**

[SetItem(int, OpcNodeId)](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.collection-1.setitem)
