# OpcContentFilterElement Members

> Reference: Represents an element of an OpcContentFilter, which applies an operator to its operands.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcContentFilterElement</a></dd>
<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>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

## Constructors

### OpcContentFilterElement

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

| Overload | Description |
|---|---|
| [OpcContentFilterElement(OpcFilterOperator, params OpcFilterOperand\[\])](#opccontentfilterelement-opc-uafx-opcfilteroperator-opc-uafx-opcfilteroperand-array) | Initializes a new instance of the [OpcContentFilterElement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/) class using the `elementOperator` and `elementOperands` specified. |
| [OpcContentFilterElement(OpcFilterOperator, IEnumerable&lt;OpcFilterOperand&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/members#opccontentfilterelement-opc-uafx-opcfilteroperator-system-collections-generic-ienumerable-of-opc-uafx-opcfilteroperand) | Initializes a new instance of the [OpcContentFilterElement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/) class using the `elementOperator` and `elementOperands` specified. |

**Exceptions (all overloads)**

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

#### OpcContentFilterElement(OpcFilterOperator, params OpcFilterOperand\[\])

Initializes a new instance of the [OpcContentFilterElement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/) class using the `elementOperator` and `elementOperands` specified.

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

```csharp
public OpcContentFilterElement(
    OpcFilterOperator elementOperator,
    params OpcFilterOperand[] elementOperands)
```

</div>

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

```vbnet
Public Sub New(
    elementOperator As OpcFilterOperator,
    ParamArray elementOperands As OpcFilterOperand())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `elementOperator` | [OpcFilterOperator](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilteroperator/) | The operator of the element. |
| `elementOperands` | params [OpcFilterOperand](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilteroperand/)[] | The operands of the element. |

#### OpcContentFilterElement(OpcFilterOperator, IEnumerable&lt;OpcFilterOperand&gt;)

Initializes a new instance of the [OpcContentFilterElement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/) class using the `elementOperator` and `elementOperands` specified.

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

```csharp
public OpcContentFilterElement(
    OpcFilterOperator elementOperator,
    IEnumerable<OpcFilterOperand> elementOperands)
```

</div>

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

```vbnet
Public Sub New(
    elementOperator As OpcFilterOperator,
    elementOperands As IEnumerable(Of OpcFilterOperand))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `elementOperator` | [OpcFilterOperator](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilteroperator/) | The operator of the element. |
| `elementOperands` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcFilterOperand](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilteroperand/)&gt; | A sequence of the operands of the element. |

## Properties

### Operands

Gets the operands of the element.

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

```csharp
public OpcFilterOperandReadOnlyCollection Operands { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Operands As OpcFilterOperandReadOnlyCollection
```

</div>

**Property value**

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

A read-only collection of the operands in the order the operator uses them.

### Operator

Gets the operator of the element.

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

```csharp
public OpcFilterOperator Operator { get; }
```

</div>

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

```vbnet
Public ReadOnly Property [Operator] As OpcFilterOperator
```

</div>

**Property value**

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

The operator applied to the [Operands](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/members#operands).

## Methods

### ToString

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

Returns a string that represents the element.

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

```csharp
public override string ToString()
```

</div>

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

```vbnet
Public Overrides Function ToString() As String
```

</div>

**Returns**

[String](https://learn.microsoft.com/dotnet/api/system.string)

The string representation of the element provided by the OPC UA stack.

**Overrides**

[ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Operators

### BitwiseAnd

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

| Overload | Description |
|---|---|
| [operator &amp;(OpcContentFilter, OpcContentFilterElement)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/members#op-bitwiseand-opc-uafx-opccontentfilter-opc-uafx-opccontentfilterelement)<span class="api-meta">static</span> | Combines the filter `left` and the element `right` using a logical AND. |
| [operator &amp;(OpcContentFilterElement, OpcContentFilter)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/members#op-bitwiseand-opc-uafx-opccontentfilterelement-opc-uafx-opccontentfilter)<span class="api-meta">static</span> | Combines the element `left` and the filter `right` using a logical AND. |
| [operator &amp;(OpcContentFilterElement, OpcContentFilterElement)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/members#op-bitwiseand-opc-uafx-opccontentfilterelement-opc-uafx-opccontentfilterelement)<span class="api-meta">static</span> | Creates a filter which combines the elements `left` and `right` using a logical AND. |

**Exceptions (all overloads)**

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

#### operator &amp;(OpcContentFilter, OpcContentFilterElement)

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

Combines the filter `left` and the element `right` using a logical AND.

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

```csharp
public static OpcContentFilter operator &(
    OpcContentFilter left,
    OpcContentFilterElement right)
```

</div>

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

```vbnet
Public Shared Operator And(
    left As OpcContentFilter,
    right As OpcContentFilterElement) As OpcContentFilter
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `left` | [OpcContentFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilter/) | The filter to combine. |
| `right` | [OpcContentFilterElement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/) | The element to combine. |

**Returns**

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

The filter `left`, which has been extended by an element using the operator [And](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilteroperator/#and).

**Remarks**

The filter `left` is changed and returned. The new element combines the filter as it has been so far with the other element.

#### operator &amp;(OpcContentFilterElement, OpcContentFilter)

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

Combines the element `left` and the filter `right` using a logical AND.

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

```csharp
public static OpcContentFilter operator &(
    OpcContentFilterElement left,
    OpcContentFilter right)
```

</div>

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

```vbnet
Public Shared Operator And(
    left As OpcContentFilterElement,
    right As OpcContentFilter) As OpcContentFilter
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `left` | [OpcContentFilterElement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/) | The element to combine. |
| `right` | [OpcContentFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilter/) | The filter to combine. |

**Returns**

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

The filter `right`, which has been extended by an element using the operator [And](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilteroperator/#and).

**Remarks**

The filter `right` is changed and returned. The new element combines the filter as it has been so far with the other element.

#### operator &amp;(OpcContentFilterElement, OpcContentFilterElement)

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

Creates a filter which combines the elements `left` and `right` using a logical AND.

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

```csharp
public static OpcContentFilter operator &(
    OpcContentFilterElement left,
    OpcContentFilterElement right)
```

</div>

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

```vbnet
Public Shared Operator And(
    left As OpcContentFilterElement,
    right As OpcContentFilterElement) As OpcContentFilter
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `left` | [OpcContentFilterElement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/) | The element to combine. |
| `right` | [OpcContentFilterElement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/) | The element to combine. |

**Returns**

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

A new [OpcContentFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilter/) whose element using the operator [And](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilteroperator/#and) combines both elements.

### BitwiseOr

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

| Overload | Description |
|---|---|
| [operator \|(OpcContentFilter, OpcContentFilterElement)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/members#op-bitwiseor-opc-uafx-opccontentfilter-opc-uafx-opccontentfilterelement)<span class="api-meta">static</span> | Combines the filter `left` and the element `right` using a logical OR. |
| [operator \|(OpcContentFilterElement, OpcContentFilter)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/members#op-bitwiseor-opc-uafx-opccontentfilterelement-opc-uafx-opccontentfilter)<span class="api-meta">static</span> | Combines the element `left` and the filter `right` using a logical OR. |
| [operator \|(OpcContentFilterElement, OpcContentFilterElement)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/members#op-bitwiseor-opc-uafx-opccontentfilterelement-opc-uafx-opccontentfilterelement)<span class="api-meta">static</span> | Creates a filter which combines the elements `left` and `right` using a logical OR. |

**Exceptions (all overloads)**

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

#### operator |(OpcContentFilter, OpcContentFilterElement)

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

Combines the filter `left` and the element `right` using a logical OR.

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

```csharp
public static OpcContentFilter operator |(
    OpcContentFilter left,
    OpcContentFilterElement right)
```

</div>

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

```vbnet
Public Shared Operator Or(
    left As OpcContentFilter,
    right As OpcContentFilterElement) As OpcContentFilter
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `left` | [OpcContentFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilter/) | The filter to combine. |
| `right` | [OpcContentFilterElement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/) | The element to combine. |

**Returns**

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

The filter `left`, which has been extended by an element using the operator [Or](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilteroperator/#or).

**Remarks**

The filter `left` is changed and returned. The new element combines the filter as it has been so far with the other element.

#### operator |(OpcContentFilterElement, OpcContentFilter)

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

Combines the element `left` and the filter `right` using a logical OR.

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

```csharp
public static OpcContentFilter operator |(
    OpcContentFilterElement left,
    OpcContentFilter right)
```

</div>

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

```vbnet
Public Shared Operator Or(
    left As OpcContentFilterElement,
    right As OpcContentFilter) As OpcContentFilter
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `left` | [OpcContentFilterElement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/) | The element to combine. |
| `right` | [OpcContentFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilter/) | The filter to combine. |

**Returns**

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

The filter `right`, which has been extended by an element using the operator [Or](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilteroperator/#or).

**Remarks**

The filter `right` is changed and returned. The new element combines the filter as it has been so far with the other element.

#### operator |(OpcContentFilterElement, OpcContentFilterElement)

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

Creates a filter which combines the elements `left` and `right` using a logical OR.

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

```csharp
public static OpcContentFilter operator |(
    OpcContentFilterElement left,
    OpcContentFilterElement right)
```

</div>

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

```vbnet
Public Shared Operator Or(
    left As OpcContentFilterElement,
    right As OpcContentFilterElement) As OpcContentFilter
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `left` | [OpcContentFilterElement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/) | The element to combine. |
| `right` | [OpcContentFilterElement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilterelement/) | The element to combine. |

**Returns**

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

A new [OpcContentFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontentfilter/) whose element using the operator [Or](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilteroperator/#or) combines both elements.
