# OpcEncoding Members

> Reference: Identifies how data is encoded on the wire and therefore describes in which way information is serialized or deserialized.

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

## Properties

### DefaultBinary

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

Gets the foundation defined encoding used by default to encode information using the binary representation (known as 'OPC UA Binary') of the information to serialize or deserialize.

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

```csharp
public static OpcEncoding DefaultBinary { get; }
```

</div>

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

```vbnet
Public Shared ReadOnly Property DefaultBinary As OpcEncoding
```

</div>

**Property value**

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

An instance of the [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) class used to define the OPC UA Binary encoding. The [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) instance provided identifies a data independent encoding and does therefore not refer to a specific node which refers to the [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) used by the instance ([Id](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/members#id) is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null)).

### DefaultXml

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

Gets the foundation defined encoding used by default to encode information using a XML-based serialization format (known as 'OPC UA XML') to serialize or deserialize information.

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

```csharp
public static OpcEncoding DefaultXml { get; }
```

</div>

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

```vbnet
Public Shared ReadOnly Property DefaultXml As OpcEncoding
```

</div>

**Property value**

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

An instance of the [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) class used to define the OPC UA XML encoding. The [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) instance provided identifies a data independent encoding and does therefore not refer to a specific node which refers to the [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) used by the instance ([Id](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/members#id) is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null)).

### Id

Gets the identifier of the node which refers to a specific [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) (defined by [Type](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/members#type)) used to encode information.

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

```csharp
public OpcNodeId Id { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Id As OpcNodeId
```

</div>

**Property value**

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

An instance of the [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) class which either identifies a data type specific encoding or [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null) in case there this [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) represents one of the default encodings defined by the foundation.

### Namespace

Gets the namespace within the encoding has been defined. This can be the same namespace as referenced by data type dictioanries using their NamespaceUri property.

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

```csharp
public OpcNamespace Namespace { get; }
```

</div>

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

```vbnet
Public ReadOnly Property [Namespace] As OpcNamespace
```

</div>

**Property value**

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

An instance of the [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/) class which refers to the namespace within the encoding has been defined. These instance may be the same [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/) as used by the [Id](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/members#id) (see [Namespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#namespace)) or a custom namespace which in case of data type encodings have to be the same namespace as referenced by data type dictionaries using their NamespaceUri property.

### Type

Gets a value which identifies the underlying logic used to encode information.

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

```csharp
public OpcEncodingType Type { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Type As OpcEncodingType
```

</div>

**Property value**

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

One of the members defined by the [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) enumeration.

## Methods

### All

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

| Overload | Description |
|---|---|
| [All(OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/members#all-opc-uafx-opcnodeid)<span class="api-meta">static</span> | Retrieves for each supported [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) a new [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) while each uses the `id` specified. |
| [All(OpcNodeId, OpcNamespace)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/members#all-opc-uafx-opcnodeid-opc-uafx-opcnamespace)<span class="api-meta">static</span> | Retrieves for each supported [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) a new [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) while each uses the `id` and `encodingNamespace` specified. |

**Exceptions (all overloads)**

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

#### All(OpcNodeId)

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

Retrieves for each supported [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) a new [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) while each uses the `id` specified.

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

```csharp
public static OpcEncoding[] All(OpcNodeId id)
```

</div>

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

```vbnet
Public Shared Function All(id As OpcNodeId) As OpcEncoding()
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `id` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The identifier of the node which relates to the encodings offered. |

**Returns**

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

An array of [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) instances representing all [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/)s supported while referencing to the encoding node specified by `id`.

#### All(OpcNodeId, OpcNamespace)

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

Retrieves for each supported [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) a new [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) while each uses the `id` and `encodingNamespace` specified.

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

```csharp
public static OpcEncoding[] All(OpcNodeId id, OpcNamespace encodingNamespace)
```

</div>

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

```vbnet
Public Shared Function All(
    id As OpcNodeId,
    encodingNamespace As OpcNamespace) As OpcEncoding()
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `id` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The identifier of the node which relates to the encodings offered. |
| `encodingNamespace` | [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/) | The [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/) which refers to the namespace within the encodings has been defined. In case of data type encodings this [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/) instance have to be the same namespace as referenced by data type dictionaries using their NamespaceUri property. This parameter can be a null reference (Nothing in Visual Basic); in this case the [Namespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#namespace) of the `id` specified is used instead. |

**Returns**

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

An array of [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) instances representing all [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/)s supported while referencing to the encoding node specified by `id`.

### Binary

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

| Overload | Description |
|---|---|
| [Binary(OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/members#binary-opc-uafx-opcnodeid)<span class="api-meta">static</span> | Retrieves a new [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) which uses the `id` specified to define an encoding which uses the logic used for binary data encoding. |
| [Binary(OpcNodeId, OpcNamespace)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/members#binary-opc-uafx-opcnodeid-opc-uafx-opcnamespace)<span class="api-meta">static</span> | Retrieves a new [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) which uses the `id` and `encodingNamespace` specified to define an encoding which uses the logic used for binary data encoding. |
| [Binary(params OpcEncoding\[\])](#binary-opc-uafx-opcencoding-array)<span class="api-meta">static</span> | Selects the first [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) in `encodings` which defines an encoding which uses the [Binary](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/#binary) encoding type as the logic used to encode data. |

#### Binary(OpcNodeId)

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

Retrieves a new [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) which uses the `id` specified to define an encoding which uses the logic used for binary data encoding.

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

```csharp
public static OpcEncoding Binary(OpcNodeId id)
```

</div>

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

```vbnet
Public Shared Function Binary(id As OpcNodeId) As OpcEncoding
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `id` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The identifier of the node which relates to the encoding offered. |

**Returns**

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

A new instance of the [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) class representing the encoding node specified by the `id` while using the [Binary](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/#binary) encoding type as the [Type](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/members#type) of encoding.

**Exceptions**

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

#### Binary(OpcNodeId, OpcNamespace)

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

Retrieves a new [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) which uses the `id` and `encodingNamespace` specified to define an encoding which uses the logic used for binary data encoding.

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

```csharp
public static OpcEncoding Binary(OpcNodeId id, OpcNamespace encodingNamespace)
```

</div>

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

```vbnet
Public Shared Function Binary(
    id As OpcNodeId,
    encodingNamespace As OpcNamespace) As OpcEncoding
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `id` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The identifier of the node which relates to the encoding offered. |
| `encodingNamespace` | [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/) | The [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/) which refers to the namespace within the encoding has been defined. In case of data type encodings this [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/) instance have to be the same namespace as referenced by data type dictionaries using their NamespaceUri property. This parameter can be a null reference (Nothing in Visual Basic); in this case the [Namespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#namespace) of the `id` specified is used instead. |

**Returns**

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

A new instance of the [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) class representing the encoding node specified by the `id` within the further defined `encodingNamespace` while using the [Binary](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/#binary) encoding type as the [Type](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/members#type) of encoding.

**Exceptions**

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

#### Binary(params OpcEncoding\[\])

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

Selects the first [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) in `encodings` which defines an encoding which uses the [Binary](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/#binary) encoding type as the logic used to encode data.

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

```csharp
public static OpcEncoding Binary(params OpcEncoding[] encodings)
```

</div>

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

```vbnet
Public Shared Function Binary(
    ParamArray encodings As OpcEncoding()) As OpcEncoding
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `encodings` | params [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/)[] | An array of [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) instances from which the first binary encoding is to be selected. |

**Returns**

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

The first binary [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) in `encodings` or a null reference (Nothing in Visual Basic)

### Default

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

Retrieves the according default [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) which is used for the `encodingType` specified.

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

```csharp
public static OpcEncoding Default(OpcEncodingType encodingType)
```

</div>

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

```vbnet
Public Shared Function [Default](encodingType As OpcEncodingType) As OpcEncoding
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `encodingType` | [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) | The [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) for that the according default [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) is to be determined. |

**Returns**

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

The default [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) used for the `encodingType` specified.

### Empty

<span class="api-meta">static · since v2.50</span>

Returns an empty array of the type [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/).

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

```csharp
public static OpcEncoding[] Empty()
```

</div>

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

```vbnet
Public Shared Function Empty() As OpcEncoding()
```

</div>

**Returns**

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

Returns an empty [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) array.

### Equals

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

| Overload | Description |
|---|---|
| [Equals(object)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/members#equals-system-object)<span class="api-meta">override</span> | Determines whether the specified `other` is equal to this [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/). |
| [Equals(OpcEncoding)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/members#equals-opc-uafx-opcencoding) | Determines whether the specified `other` is equal to this [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/). |

#### Equals(object)

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

Determines whether the specified `other` is equal to this [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/).

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

```csharp
public override bool Equals(object other)
```

</div>

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

```vbnet
Public Overrides Function Equals(other As Object) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `other` | [Object](https://learn.microsoft.com/dotnet/api/system.object) | The [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) to compare to the current [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/). |

**Returns**

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

The value true if the specified [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) is equal to the current [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/); otherwise the value false.

**Overrides**

[Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals%28system-object%29)

#### Equals(OpcEncoding)

Determines whether the specified `other` is equal to this [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/).

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

```csharp
public bool Equals(OpcEncoding other)
```

</div>

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

```vbnet
Public Function Equals(other As OpcEncoding) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `other` | [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) | The [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) to compare to the current [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/). |

**Returns**

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

The value true if the specified [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) is equal to the current [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/); otherwise the value false.

**Implements**

[Equals(OpcEncoding)](https://learn.microsoft.com/dotnet/api/system.iequatable-1.equals)

### GetHashCode

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

Retrieves a hash code for this [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/).

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

```csharp
public override int GetHashCode()
```

</div>

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

```vbnet
Public Overrides Function GetHashCode() As Integer
```

</div>

**Returns**

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

An [int](https://learn.microsoft.com/dotnet/api/system.int32) that contains the hash code for the [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/).

**Overrides**

[GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)

### GetType

<span class="api-meta">static · since v2.9</span>

Determines the expressed type of encoding using the information encoded in the `encodingName` specified.

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

```csharp
public static OpcEncodingType? GetType(string encodingName)
```

</div>

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

```vbnet
Public Shared Function [GetType](encodingName As String) As OpcEncodingType?
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `encodingName` | [String](https://learn.microsoft.com/dotnet/api/system.string) | A [string](https://learn.microsoft.com/dotnet/api/system.string) expressing the name of a specific encoding from which the according [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) is to be determined. |

**Returns**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/)&gt;

One of the members defined by the [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) enumeration or a null reference (Nothing in Visual Basic) in case there no encoding type related information could be determined in the `encodingName`.

### Of

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

Selects the first [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) in `encodings` which defines an encoding which uses the `encodingType` specified as the logic used to encode data.

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

```csharp
public static OpcEncoding[] Of(
    OpcEncodingType encodingType,
    params OpcEncoding[] encodings)
```

</div>

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

```vbnet
Public Shared Function [Of](
    encodingType As OpcEncodingType,
    ParamArray encodings As OpcEncoding()) As OpcEncoding()
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `encodingType` | [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) | The type of encoding the [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) instance is to be selected from the `encodings` specified. |
| `encodings` | params [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/)[] | An array of [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) instances from which the first encoding with of the `encodingType` specified is to be selected. |

**Returns**

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

The first [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) in `encodings` of the `encodingType` specified or a null reference (Nothing in Visual Basic).

### ToString

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

Returns a string representing the encoding described.

<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)

A string represening the information used by this [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) instance.

**Overrides**

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

### Xml

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

| Overload | Description |
|---|---|
| [Xml(OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/members#xml-opc-uafx-opcnodeid)<span class="api-meta">static</span> | Retrieves a new [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) which uses the `id` specified to define an encoding which uses the logic used for XML data encoding. |
| [Xml(OpcNodeId, OpcNamespace)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/members#xml-opc-uafx-opcnodeid-opc-uafx-opcnamespace)<span class="api-meta">static</span> | Retrieves a new [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) which uses the `id` and `encodingNamespace` specified to define an encoding which uses the logic used for XML data encoding. |
| [Xml(params OpcEncoding\[\])](#xml-opc-uafx-opcencoding-array)<span class="api-meta">static</span> | Selects the first [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) in `encodings` which defines an encoding which uses the [Xml](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/#xml) encoding type as the logic used to encode data. |

#### Xml(OpcNodeId)

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

Retrieves a new [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) which uses the `id` specified to define an encoding which uses the logic used for XML data encoding.

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

```csharp
public static OpcEncoding Xml(OpcNodeId id)
```

</div>

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

```vbnet
Public Shared Function Xml(id As OpcNodeId) As OpcEncoding
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `id` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The identifier of the node which relates to the encoding offered. |

**Returns**

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

A new instance of the [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) class representing the encoding node specified by the `id` while using the [Xml](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/#xml) encoding type as the [Type](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/members#type) of encoding.

**Exceptions**

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

#### Xml(OpcNodeId, OpcNamespace)

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

Retrieves a new [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) which uses the `id` and `encodingNamespace` specified to define an encoding which uses the logic used for XML data encoding.

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

```csharp
public static OpcEncoding Xml(OpcNodeId id, OpcNamespace encodingNamespace)
```

</div>

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

```vbnet
Public Shared Function Xml(
    id As OpcNodeId,
    encodingNamespace As OpcNamespace) As OpcEncoding
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `id` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The identifier of the node which relates to the encoding offered. |
| `encodingNamespace` | [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/) | The [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/) which referes to the namespace within the encoding has been defined. In case of data type encodings this [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/) instance have to be the same namespace as referenced by data type dictionaries using their NamespaceUri property. This parameter can be a null reference (Nothing in Visual Basic); in this case the [Namespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#namespace) of the `id` specified is used instead. |

**Returns**

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

A new instance of the [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) class representing the encoding node specified by the `id` within the further defined `encodingNamespace` while using the [Xml](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/#xml) encoding type as the [Type](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/members#type) of encoding.

**Exceptions**

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

#### Xml(params OpcEncoding\[\])

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

Selects the first [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) in `encodings` which defines an encoding which uses the [Xml](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/#xml) encoding type as the logic used to encode data.

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

```csharp
public static OpcEncoding Xml(params OpcEncoding[] encodings)
```

</div>

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

```vbnet
Public Shared Function Xml(ParamArray encodings As OpcEncoding()) As OpcEncoding
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `encodings` | params [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/)[] | An array of [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) instances from which the first XML encoding is to be selected. |

**Returns**

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

The first XML [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) in `encodings` or a null reference (Nothing in Visual Basic)

## Operators

### Equality

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

Returns a value indicating whether two instance of [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) are equal.

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

```csharp
public static bool operator ==(OpcEncoding left, OpcEncoding right)
```

</div>

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

```vbnet
Public Shared Operator =(left As OpcEncoding, right As OpcEncoding) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `left` | [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) | The first [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) to compare. |
| `right` | [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) | The second [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) to compare. |

**Returns**

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

The value true if left and right are equal; otherwise the value false.

### Inequality

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

Returns a value indicating whether two instances of [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) are not equal.

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

```csharp
public static bool operator !=(OpcEncoding left, OpcEncoding right)
```

</div>

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

```vbnet
Public Shared Operator <>(left As OpcEncoding, right As OpcEncoding) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `left` | [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) | The first [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) to compare. |
| `right` | [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) | The second [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) to compare. |

**Returns**

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

The value true if left and right are not equal; otherwise the value false.
