# OpcMemberSwitch Class

<span class="api-meta">since v2.8</span>

<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">OpcMemberSwitch Members</a></dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

Declares the condition under which an optional member exists in dependency of the value of a switch member. The switch member can be either a single bit in the 'EncodingMask' or a different member its value is compared to a switch value (see [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberswitch/members#value)).

## Syntax

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

```csharp
public class OpcMemberSwitch
```

</div>

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

```vbnet
Public Class OpcMemberSwitch
```

</div>

## Inheritance

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

## Constructors

| Name | Description |
|---|---|
| [OpcMemberSwitch](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberswitch/members#opcmemberswitch)<span class="api-meta">4 overloads</span> | Initializes a new instance of the OpcMemberSwitch class which refers to the `bit` specified. |

## Properties

| Name | Description |
|---|---|
| [Bit](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberswitch/members#bit) | Gets the zero-based number of the bit in the 'EncodingMask' which controls the existence of an optional member. |
| [Conditions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberswitch/members#conditions)<span class="api-meta">since v2.9</span> | Gets a value which identities in which way the current OpcMemberSwitch decides whether a member exists. |
| [Name](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberswitch/members#name) | Gets the name of the switch member its value is compared to control the existence of an optional member. |
| [Operator](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberswitch/members#operator) | Gets a value which defines the relational operator to use when comparing the value of a referenced [Bit](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberswitch/members#bit) or the value of a referenced switch member refered to by [Name](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberswitch/members#name). |
| [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberswitch/members#value) | Gets the value towards the value of the switch member, referenced by the [Bit](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberswitch/members#bit) of the 'EncodingMask' or by the [Name](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberswitch/members#name), is to be compared using the [Operator](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberswitch/members#operator) of the OpcMemberSwitch. |

## Methods

| Name | Description |
|---|---|
| [Equals](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberswitch/members#equals)<span class="api-meta">static · since v2.32</span> | Provides a generic named equality OpcMemberSwitch evaluating to the `value` specified. |
| [Matches](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberswitch/members#matches) | Evaluates the switch condition against the `value` specified. |
| [ToString](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberswitch/members#tostring)<span class="api-meta">override</span> | Returns a [string](https://learn.microsoft.com/dotnet/api/system.string) representing the information used by the current OpcMemberSwitch. |

## Applies to

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