# OpcNodeHistory&lt;T&gt; Class

<dl class="api-definition">
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.server">Opc.UaFx.Server</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">OpcNodeHistory&lt;T&gt; Members</a></dd>
</dl>

Represents a history of values kept in memory in ascending order of their timestamps, with at most one value per timestamp.

## Syntax

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

```csharp
public class OpcNodeHistory<T> where T : OpcHistoryValue
```

</div>

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

```vbnet
Public Class OpcNodeHistory(Of T As OpcHistoryValue)
```

</div>

## Type parameters

| Name | Description |
|---|---|
| `T` | The type of the values, [OpcHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opchistoryvalue/) or a type derived from it. |

## Inheritance

[Object](https://learn.microsoft.com/dotnet/api/system.object) → **OpcNodeHistory&lt;T&gt;**

## Implements

<ul class="api-implements">
<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;T&gt;</li>
</ul>

## Remarks

The timestamp of a value is its [Timestamp](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opchistoryvalue/members#timestamp); for an [OpcModifiedHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmodifiedhistoryvalue/) this is the time of its modification.

## Constructors

| Name | Description |
|---|---|
| [OpcNodeHistory](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#opcnodehistory)<span class="api-meta">6 overloads</span> | Initializes a new instance of the OpcNodeHistory&lt;T&gt; class whose [Capacity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#capacity) is -1 (unlimited). |

## Properties

| Name | Description |
|---|---|
| [Capacity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#capacity) | Gets the maximum number of values the history keeps. |
| [Count](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#count) | Gets the number of values in the history. |
| [EnableRaisingEvents](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#enableraisingevents) | Gets or sets a value indicating whether the history raises the events [Added](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#added), [Removed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#removed) and [Replaced](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#replaced). |
| [EndTime](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#endtime) | Gets the latest timestamp of the values in the history. |
| [StartTime](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#starttime) | Gets the earliest timestamp of the values in the history. |

## Methods

| Name | Description |
|---|---|
| [Add](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#add) | Adds the `value` specified to the history and raises the [Added](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#added) event. |
| [AddRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#addrange)<span class="api-meta">2 overloads</span> | Adds the `values` specified to the history and raises the [Added](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#added) event. |
| [Clear](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#clear) | Removes all values from the history and raises the [Removed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#removed) event. |
| [Contains](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#contains)<span class="api-meta">2 overloads</span> | Determines whether the history contains a value at the `timestamp` specified. |
| [Enumerate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#enumerate)<span class="api-meta">3 overloads</span> | Enumerates the values of the history in ascending order of their timestamps. |
| [GetEnumerator](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#getenumerator) | Returns an enumerator which iterates through the values of the history in ascending order of their timestamps. |
| [OnAdded](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#onadded)<span class="api-meta">protected · virtual</span> | Raises the [Added](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#added) event using the specified event data. |
| [OnRemoved](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#onremoved)<span class="api-meta">protected · virtual</span> | Raises the [Removed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#removed) event using the specified event data. |
| [OnReplaced](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#onreplaced)<span class="api-meta">protected · virtual</span> | Raises the [Replaced](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#replaced) event using the specified event data. |
| [Remove](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#remove) | Removes the `value` specified from the history and raises the [Removed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#removed) event. |
| [RemoveAt](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#removeat)<span class="api-meta">4 overloads</span> | Removes the value at the `index` specified in the ascending order of the timestamps and raises the [Removed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#removed) event. |
| [RemoveRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#removerange)<span class="api-meta">2 overloads</span> |  |
| [Replace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#replace) | Replaces the value at the timestamp of the `value` specified with the `value` and raises the [Replaced](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#replaced) event. |

## Events

| Name | Description |
|---|---|
| [Added](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#added) | Occurs after values have been added to the history. |
| [Removed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#removed) | Occurs after values have been removed from the history, also if a value has been removed because the history reached its [Capacity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#capacity). |
| [Replaced](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#replaced) | Occurs after a value of the history has been replaced. |

## Indexers

| Name | Description |
|---|---|
| [Item](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistory-1/members#item)<span class="api-meta">2 overloads</span> | Gets or sets the value at the `index` specified in the ascending order of the timestamps. |

## Applies to

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