# OpcMonitoredItemCollection Members

> Reference: Represents a collection of OpcMonitoredItem instances keyed by their ClientID.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcMonitoredItemCollection</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.client">Opc.UaFx.Client</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 [KeyedCollection&lt;Int64, OpcMonitoredItem&gt;](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.keyedcollection-2), [Collection&lt;OpcMonitoredItem&gt;](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.collection-1).

## Constructors

### OpcMonitoredItemCollection

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

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

```csharp
public OpcMonitoredItemCollection()
```

</div>

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

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

</div>

## Methods

### GetKeyForItem

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

Gets the key of the `item` specified.

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

```csharp
protected override long GetKeyForItem(OpcMonitoredItem item)
```

</div>

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

```vbnet
Protected Overrides Function GetKeyForItem(item As OpcMonitoredItem) As Long
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `item` | [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) | The [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) whose key is to be determined. |

**Returns**

[Int64](https://learn.microsoft.com/dotnet/api/system.int64)

The [ClientID](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/members#clientid) of the `item`.

**Exceptions**

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

**Overrides**

[GetKeyForItem(OpcMonitoredItem)](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.keyedcollection-2.getkeyforitem)
