# OpcModifiedNodeHistory Members

> Reference: Represents the modified history of a node: the values which have been inserted, replaced, updated or deleted, each together with the information about its modification.

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

## Constructors

### OpcModifiedNodeHistory

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

| Overload | Description |
|---|---|
| [OpcModifiedNodeHistory()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#opcmodifiednodehistory-noparams) | Initializes a new instance of the [OpcModifiedNodeHistory](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/) class whose [Capacity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#capacity) is -1 (unlimited). |
| [OpcModifiedNodeHistory(int)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#opcmodifiednodehistory-system-int32) | Initializes a new instance of the [OpcModifiedNodeHistory](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/) class using the `capacity` specified. |
| [OpcModifiedNodeHistory(IEnumerable&lt;OpcModifiedHistoryValue&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#opcmodifiednodehistory-system-collections-generic-ienumerable-of-opc-uafx-opcmodifiedhistoryvalue) | Initializes a new instance of the [OpcModifiedNodeHistory](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/) class using the `values` specified. |
| [OpcModifiedNodeHistory(int, IEnumerable&lt;OpcModifiedHistoryValue&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#opcmodifiednodehistory-system-int32-system-collections-generic-ienumerable-of-opc-uafx-opcmodifiedhistoryvalue) | Initializes a new instance of the [OpcModifiedNodeHistory](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/) class using the `capacity` and `values` specified. |

#### OpcModifiedNodeHistory()

Initializes a new instance of the [OpcModifiedNodeHistory](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/) class whose [Capacity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#capacity) is -1 (unlimited).

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

```csharp
public OpcModifiedNodeHistory()
```

</div>

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

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

</div>

#### OpcModifiedNodeHistory(int)

Initializes a new instance of the [OpcModifiedNodeHistory](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/) class using the `capacity` specified.

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

```csharp
public OpcModifiedNodeHistory(int capacity)
```

</div>

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

```vbnet
Public Sub New(capacity As Integer)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `capacity` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The maximum number of values the history keeps: -1 (unlimited) or a positive number. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception) | The `capacity` is 0 or less than -1. |

#### OpcModifiedNodeHistory(IEnumerable&lt;OpcModifiedHistoryValue&gt;)

Initializes a new instance of the [OpcModifiedNodeHistory](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/) class using the `values` specified.

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

```csharp
public OpcModifiedNodeHistory(IEnumerable<OpcModifiedHistoryValue> values)
```

</div>

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

```vbnet
Public Sub New(values As IEnumerable(Of OpcModifiedHistoryValue))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `values` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcModifiedHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmodifiedhistoryvalue/)&gt; | A sequence of the values to add to the history. |

**Exceptions**

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

#### OpcModifiedNodeHistory(int, IEnumerable&lt;OpcModifiedHistoryValue&gt;)

Initializes a new instance of the [OpcModifiedNodeHistory](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/) class using the `capacity` and `values` specified.

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

```csharp
public OpcModifiedNodeHistory(
    int capacity,
    IEnumerable<OpcModifiedHistoryValue> values)
```

</div>

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

```vbnet
Public Sub New(
    capacity As Integer,
    values As IEnumerable(Of OpcModifiedHistoryValue))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `capacity` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The maximum number of values the history keeps: -1 (unlimited) or a positive number. |
| `values` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcModifiedHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmodifiedhistoryvalue/)&gt; | A sequence of the values to add to the history. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `values` or one of its items is a null reference (Nothing in Visual Basic). |
| [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception) | The `capacity` is 0 or less than -1. |

**Remarks**

The values are added like using [AddRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#addrange-system-collections-generic-ienumerable-of-opc-uafx-opcmodifiedhistoryvalue), so that a history which reaches its [Capacity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#capacity) removes values as described there.

## Properties

### Capacity

Gets the maximum number of values the history keeps.

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

```csharp
public int Capacity { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Capacity As Integer
```

</div>

**Property value**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

The maximum number of values: -1 (unlimited) or a positive number.

**Remarks**

When a value is added to a history which has reached its capacity, the oldest modification is removed first, regardless of the timestamps of the values: the value with the earliest [ModificationTime](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmodifiedhistoryvalue/members#modificationtime) and, for the same modification time, the value added first. Then the [Removed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#removed) event is raised.

### Count

Gets the number of values in the history.

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

```csharp
public int Count { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Count As Integer
```

</div>

**Property value**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

The number of values, counting each modification of a value.

### EnableRaisingEvents

Gets or sets a value indicating whether the history raises its events.

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

```csharp
public bool EnableRaisingEvents { get; set; }
```

</div>

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

```vbnet
Public Property EnableRaisingEvents As Boolean
```

</div>

**Property value**

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

The value true to raise the events [Added](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#added) and [Removed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#removed); otherwise the value false. The default value is true.

### EndTime

Gets the latest timestamp of the values in the history.

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

```csharp
public DateTime? EndTime { get; }
```

</div>

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

```vbnet
Public ReadOnly Property EndTime As Date?
```

</div>

**Property value**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt;

The timestamp of the last value or a null reference (Nothing in Visual Basic) if the history is empty.

### StartTime

Gets the earliest timestamp of the values in the history.

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

```csharp
public DateTime? StartTime { get; }
```

</div>

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

```vbnet
Public ReadOnly Property StartTime As Date?
```

</div>

**Property value**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt;

The timestamp of the first value or a null reference (Nothing in Visual Basic) if the history is empty.

## Methods

### Add

Adds the `value` specified to the history.

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

```csharp
public void Add(OpcModifiedHistoryValue value)
```

</div>

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

```vbnet
Public Sub Add(value As OpcModifiedHistoryValue)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | [OpcModifiedHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmodifiedhistoryvalue/) | The value to add. |

**Exceptions**

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

**Remarks**

A value whose timestamp is already in the history is added as a further modification of the value at that time.

### AddRange

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

| Overload | Description |
|---|---|
| [AddRange(IEnumerable&lt;OpcModifiedHistoryValue&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#addrange-system-collections-generic-ienumerable-of-opc-uafx-opcmodifiedhistoryvalue) | Adds the `values` specified to the history. |
| [AddRange(params OpcModifiedHistoryValue\[\])](#addrange-opc-uafx-opcmodifiedhistoryvalue-array) | Adds the `values` specified to the history. |

**Exceptions (all overloads)**

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

#### AddRange(IEnumerable&lt;OpcModifiedHistoryValue&gt;)

Adds the `values` specified to the history.

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

```csharp
public void AddRange(IEnumerable<OpcModifiedHistoryValue> values)
```

</div>

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

```vbnet
Public Sub AddRange(values As IEnumerable(Of OpcModifiedHistoryValue))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `values` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcModifiedHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmodifiedhistoryvalue/)&gt; | A sequence of the values to add. |

**Remarks**

No value is added if one of the items is a null reference.

#### AddRange(params OpcModifiedHistoryValue\[\])

Adds the `values` specified to the history.

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

```csharp
public void AddRange(params OpcModifiedHistoryValue[] values)
```

</div>

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

```vbnet
Public Sub AddRange(ParamArray values As OpcModifiedHistoryValue())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `values` | params [OpcModifiedHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmodifiedhistoryvalue/)[] | The values to add. |

**Remarks**

No value is added if one of the items is a null reference.

### Clear

Removes all values from the history.

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

```csharp
public void Clear()
```

</div>

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

```vbnet
Public Sub Clear()
```

</div>

### Contains

Determines whether the history contains a value with the `timestamp` specified.

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

```csharp
public bool Contains(DateTime timestamp)
```

</div>

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

```vbnet
Public Function Contains(timestamp As Date) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `timestamp` | [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) | The timestamp of the value. |

**Returns**

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

The value true if the history contains at least one value with the `timestamp`; otherwise the value false.

### Enumerate

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

| Overload | Description |
|---|---|
| [Enumerate()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#enumerate-noparams) | Gets the values of the history in their sort order. |
| [Enumerate(DateTime?)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#enumerate-system-nullable-of-system-datetime) | Gets the values whose timestamp is not earlier than the `startTime` specified. |
| [Enumerate(DateTime?, DateTime?)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#enumerate-system-nullable-of-system-datetime-system-nullable-of-system-datetime) | Gets the values whose timestamp is within the time range specified, including its bounds. |

#### Enumerate()

Gets the values of the history in their sort order.

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

```csharp
public IEnumerable<OpcModifiedHistoryValue> Enumerate()
```

</div>

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

```vbnet
Public Function Enumerate() As IEnumerable(Of OpcModifiedHistoryValue)
```

</div>

**Returns**

[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcModifiedHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmodifiedhistoryvalue/)&gt;

A sequence of all values.

**Remarks**

The sequence is a snapshot of the history.

#### Enumerate(DateTime?)

Gets the values whose timestamp is not earlier than the `startTime` specified.

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

```csharp
public IEnumerable<OpcModifiedHistoryValue> Enumerate(DateTime? startTime)
```

</div>

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

```vbnet
Public Function Enumerate(
    startTime As Date?) As IEnumerable(Of OpcModifiedHistoryValue)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `startTime` | [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt; | The earliest timestamp of the values to get. A null reference (Nothing in Visual Basic), [MinValue](https://learn.microsoft.com/dotnet/api/system.datetime.minvalue) or [MaxValue](https://learn.microsoft.com/dotnet/api/system.datetime.maxvalue) does not limit the time range. |

**Returns**

[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcModifiedHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmodifiedhistoryvalue/)&gt;

A sequence of the values within the time range.

**Remarks**

The sequence is a snapshot of the history.

#### Enumerate(DateTime?, DateTime?)

Gets the values whose timestamp is within the time range specified, including its bounds.

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

```csharp
public IEnumerable<OpcModifiedHistoryValue> Enumerate(
    DateTime? startTime,
    DateTime? endTime)
```

</div>

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

```vbnet
Public Function Enumerate(
    startTime As Date?,
    endTime As Date?) As IEnumerable(Of OpcModifiedHistoryValue)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `startTime` | [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt; | One bound of the time range. A null reference (Nothing in Visual Basic), [MinValue](https://learn.microsoft.com/dotnet/api/system.datetime.minvalue) or [MaxValue](https://learn.microsoft.com/dotnet/api/system.datetime.maxvalue) does not limit the time range. |
| `endTime` | [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt; | The other bound of the time range, with the same values for an unlimited bound as the `startTime`. |

**Returns**

[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcModifiedHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmodifiedhistoryvalue/)&gt;

A sequence of the values within the time range.

**Remarks**

If the `startTime` is later than the `endTime`, the bounds are swapped. The sequence is a snapshot of the history.

### GetEnumerator

Returns an enumerator which iterates through the values of the history.

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

```csharp
public IEnumerator<OpcModifiedHistoryValue> GetEnumerator()
```

</div>

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

```vbnet
Public Function GetEnumerator() As IEnumerator(Of OpcModifiedHistoryValue)
```

</div>

**Returns**

[IEnumerator](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1)&lt;[OpcModifiedHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmodifiedhistoryvalue/)&gt;

An enumerator of a snapshot of the history.

**Implements**

[GetEnumerator()](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1.getenumerator)

### GetValues

Gets the values with the `timestamp` specified.

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

```csharp
public IEnumerable<OpcModifiedHistoryValue> GetValues(DateTime timestamp)
```

</div>

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

```vbnet
Public Function GetValues(
    timestamp As Date) As IEnumerable(Of OpcModifiedHistoryValue)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `timestamp` | [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) | The timestamp of the values. |

**Returns**

[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcModifiedHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmodifiedhistoryvalue/)&gt;

A sequence of the modifications of the value at the `timestamp`, from the most recent to the oldest modification; an empty sequence if there is no value with the `timestamp`.

### 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.opcmodifiednodehistory/members#added) event.

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

```csharp
protected virtual void OnAdded(
    OpcNodeHistoryEventArgs<OpcModifiedHistoryValue> e)
```

</div>

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

```vbnet
Protected Overridable Sub OnAdded(
    e As OpcNodeHistoryEventArgs(Of OpcModifiedHistoryValue))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `e` | [OpcNodeHistoryEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistoryeventargs-1/)&lt;[OpcModifiedHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmodifiedhistoryvalue/)&gt; | The event data. |

### 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.opcmodifiednodehistory/members#removed) event.

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

```csharp
protected virtual void OnRemoved(
    OpcNodeHistoryEventArgs<OpcModifiedHistoryValue> e)
```

</div>

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

```vbnet
Protected Overridable Sub OnRemoved(
    e As OpcNodeHistoryEventArgs(Of OpcModifiedHistoryValue))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `e` | [OpcNodeHistoryEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistoryeventargs-1/)&lt;[OpcModifiedHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmodifiedhistoryvalue/)&gt; | The event data. |

### RemoveAt

Removes the value at the `index` specified.

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

```csharp
public void RemoveAt(int index)
```

</div>

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

```vbnet
Public Sub RemoveAt(index As Integer)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `index` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The zero-based index of the value in the sort order of the history. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception) | The `index` is less than zero or not less than [Count](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#count). |

### RemoveRange

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

| Overload | Description |
|---|---|
| [RemoveRange(DateTime?)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#removerange-system-nullable-of-system-datetime) | Removes the values whose timestamp is not earlier than the `startTime` specified. |
| [RemoveRange(DateTime?, DateTime?)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#removerange-system-nullable-of-system-datetime-system-nullable-of-system-datetime) | Removes the values whose timestamp is within the time range specified, including its bounds. |

#### RemoveRange(DateTime?)

Removes the values whose timestamp is not earlier than the `startTime` specified.

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

```csharp
public void RemoveRange(DateTime? startTime)
```

</div>

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

```vbnet
Public Sub RemoveRange(startTime As Date?)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `startTime` | [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt; | The earliest timestamp of the values to remove. A null reference (Nothing in Visual Basic), [MinValue](https://learn.microsoft.com/dotnet/api/system.datetime.minvalue) or [MaxValue](https://learn.microsoft.com/dotnet/api/system.datetime.maxvalue) does not limit the time range. |

**Remarks**

The [Removed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#removed) event is raised once for all values removed, also if no value has been removed.

#### RemoveRange(DateTime?, DateTime?)

Removes the values whose timestamp is within the time range specified, including its bounds.

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

```csharp
public void RemoveRange(DateTime? startTime, DateTime? endTime)
```

</div>

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

```vbnet
Public Sub RemoveRange(startTime As Date?, endTime As Date?)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `startTime` | [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt; | One bound of the time range. A null reference (Nothing in Visual Basic), [MinValue](https://learn.microsoft.com/dotnet/api/system.datetime.minvalue) or [MaxValue](https://learn.microsoft.com/dotnet/api/system.datetime.maxvalue) does not limit the time range. |
| `endTime` | [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt; | The other bound of the time range, with the same values for an unlimited bound as the `startTime`. |

**Remarks**

If the `startTime` is later than the `endTime`, the bounds are swapped. The [Removed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#removed) event is raised once for all values removed, also if no value has been removed.

## Events

### Added

Occurs after values have been added to the history.

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

```csharp
public event EventHandler<OpcNodeHistoryEventArgs<OpcModifiedHistoryValue>> Added
```

</div>

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

```vbnet
Public Event Added As EventHandler(Of OpcNodeHistoryEventArgs(Of OpcModifiedHistoryValue))
```

</div>

**Event type**

[EventHandler](https://learn.microsoft.com/dotnet/api/system.eventhandler-1)&lt;[OpcNodeHistoryEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistoryeventargs-1/)&lt;[OpcModifiedHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmodifiedhistoryvalue/)&gt;&gt;

### 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.opcmodifiednodehistory/members#capacity).

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

```csharp
public event EventHandler<OpcNodeHistoryEventArgs<OpcModifiedHistoryValue>> Removed
```

</div>

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

```vbnet
Public Event Removed As EventHandler(Of OpcNodeHistoryEventArgs(Of OpcModifiedHistoryValue))
```

</div>

**Event type**

[EventHandler](https://learn.microsoft.com/dotnet/api/system.eventhandler-1)&lt;[OpcNodeHistoryEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodehistoryeventargs-1/)&lt;[OpcModifiedHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmodifiedhistoryvalue/)&gt;&gt;

## Indexers

### Item

Gets the value at the `index` specified.

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

```csharp
public OpcModifiedHistoryValue this[int index] { get; }
```

</div>

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

```vbnet
Public ReadOnly Default Property this[](
    index As Integer) As OpcModifiedHistoryValue
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `index` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The zero-based index of the value in the sort order of the history. |

**Property value**

[OpcModifiedHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmodifiedhistoryvalue/)

The value at the `index`.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception) | The `index` is less than zero or not less than [Count](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmodifiednodehistory/members#count). |
