# OpcConditionExtension Members

> Reference: Provides static (Shared in Visual Basic) extension methods to manage OpcCondition objects.

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

## Methods

### AddComment

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

| Overload | Description |
|---|---|
| [AddComment(OpcCondition, OpcClient, OpcText)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcconditionextension/members#addcomment-opc-uafx-opccondition-opc-uafx-client-opcclient-opc-uafx-opctext)<span class="api-meta">static</span> | Applies a comment to the state reported by an event notification which can be identified by the [EventId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcevent/members#eventid) of the `condition` specified using the further specified `client`. |
| [AddComment(OpcCondition, OpcClient, byte\[\], OpcText)](#addcomment-opc-uafx-opccondition-opc-uafx-client-opcclient-system-byte-array-opc-uafx-opctext)<span class="api-meta">static</span> | Applies a comment to the state reported by an event notification which can be identified by the `eventId` on the `condition` specified using the further specified `client`. |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The call of the method node failed (see exception details for more information). |

#### AddComment(OpcCondition, OpcClient, OpcText)

<span class="api-meta">static</span>

Applies a comment to the state reported by an event notification which can be identified by the [EventId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcevent/members#eventid) of the `condition` specified using the further specified `client`.

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

```csharp
public static void AddComment(
    this OpcCondition condition,
    OpcClient client,
    OpcText comment)
```

</div>

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

```vbnet
Public Shared Sub AddComment(
    condition As OpcCondition,
    client As OpcClient,
    comment As OpcText)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `condition` | [OpcCondition](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccondition/) | The [OpcCondition](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccondition/) its 'AddComment' method node is to be called. |
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `comment` | [OpcText](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctext/) | The text to apply on the condition state. |

**Exceptions**

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

#### AddComment(OpcCondition, OpcClient, byte\[\], OpcText)

<span class="api-meta">static</span>

Applies a comment to the state reported by an event notification which can be identified by the `eventId` on the `condition` specified using the further specified `client`.

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

```csharp
public static void AddComment(
    this OpcCondition condition,
    OpcClient client,
    byte[] eventId,
    OpcText comment)
```

</div>

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

```vbnet
Public Shared Sub AddComment(
    condition As OpcCondition,
    client As OpcClient,
    eventId As Byte(),
    comment As OpcText)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `condition` | [OpcCondition](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccondition/) | The [OpcCondition](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccondition/) its 'AddComment' method node is to be called. |
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `eventId` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | The identifier which identifies the particular event notification its reported state for the `condition` is to be commented. |
| `comment` | [OpcText](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctext/) | The text to apply on the condition state. |

**Exceptions**

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

### Disable

<span class="api-meta">static</span>

Changes the condition state to 'Disabled' of the `condition` specified using the further specified `client`.

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

```csharp
public static void Disable(this OpcCondition condition, OpcClient client)
```

</div>

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

```vbnet
Public Shared Sub Disable(condition As OpcCondition, client As OpcClient)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `condition` | [OpcCondition](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccondition/) | The [OpcCondition](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccondition/) its 'Disable' method node is to be called. |
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `condition` or `client` is a null reference (Nothing in Visual Basic). |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The call of the method node failed (see exception details for more information). |

### Enable

<span class="api-meta">static</span>

Changes the condition state to 'Enabled' of the `condition` specified using the further specified `client`.

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

```csharp
public static void Enable(this OpcCondition condition, OpcClient client)
```

</div>

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

```vbnet
Public Shared Sub Enable(condition As OpcCondition, client As OpcClient)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `condition` | [OpcCondition](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccondition/) | The [OpcCondition](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccondition/) its 'Enable' method node is to be called. |
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `condition` or `client` is a null reference (Nothing in Visual Basic). |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The call of the method node failed (see exception details for more information). |
