# OpcReadOnlyNodeCollection Class

> Reference: Provides a read-only collection of IOpcNode instances accessible by their Id or just using an index.

<dl class="api-definition">
<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>Members</dt>
<dd><a href="./members">OpcReadOnlyNodeCollection Members</a></dd>
</dl>

Provides a read-only collection of [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) instances accessible by their [Id](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnodeinfo/members#id) or just using an index.

## Syntax

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

```csharp
public class OpcReadOnlyNodeCollection
```

</div>

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

```vbnet
Public Class OpcReadOnlyNodeCollection
```

</div>

## Inheritance

[Object](https://learn.microsoft.com/dotnet/api/system.object) → **OpcReadOnlyNodeCollection**

## Implements

<ul class="api-implements">
<li><a href="https://learn.microsoft.com/dotnet/api/system.collections.icollection">ICollection</a></li>
<li><a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.icollection-1">ICollection</a>&lt;<a href="../opc.uafx.iopcnode/">IOpcNode</a>&gt;</li>
<li><a href="https://learn.microsoft.com/dotnet/api/system.collections.ienumerable">IEnumerable</a></li>
<li><a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a href="../opc.uafx.iopcnode/">IOpcNode</a>&gt;</li>
<li><a href="https://learn.microsoft.com/dotnet/api/system.collections.ilist">IList</a></li>
<li><a href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1">IList</a>&lt;<a href="../opc.uafx.iopcnode/">IOpcNode</a>&gt;</li>
</ul>

## Properties

| Name | Description |
|---|---|
| [Count](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadonlynodecollection/members#count) | Gets the number of nodes contained in the OpcReadOnlyNodeCollection instance. |
| [Empty](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadonlynodecollection/members#empty)<span class="api-meta">static</span> | Gets an empty instance used in cases there the concrete collection does not yet exists. |
| [Items](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadonlynodecollection/members#items)<span class="api-meta">protected</span> | Gets the [IList&lt;T&gt;](https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1) that the OpcReadOnlyNodeCollection wraps. |

## Methods

| Name | Description |
|---|---|
| [Contains](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadonlynodecollection/members#contains)<span class="api-meta">2 overloads</span> | Determines whether a node is in the OpcReadOnlyNodeCollection. |
| [CopyTo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadonlynodecollection/members#copyto) | Copies the entire OpcReadOnlyNodeCollection to a compatible one-dimensional [Array](https://learn.microsoft.com/dotnet/api/system.array), starting at the specified `index` of the target `array`. |
| [GetEnumerator](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadonlynodecollection/members#getenumerator) | Returns an enumerator that iterates through the OpcReadOnlyNodeCollection. |
| [IndexOf](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadonlynodecollection/members#indexof) | Searches for the specified object and returns the zero-based index of the first occurrence within the entire OpcReadOnlyNodeCollection. |
| [TryGet](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadonlynodecollection/members#tryget)<span class="api-meta">since v2.15</span> | Tries to determine the item associated with the specified `id`. |

## Indexers

| Name | Description |
|---|---|
| [Item](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadonlynodecollection/members#item)<span class="api-meta">2 overloads</span> | Gets the node at the specified index. |

## Applies to

| Package | Versions |
|---|---|
| Opc.UaFx.Advanced | v2.5–v2.59 |
