# OpcTypes Members

> Reference: Provides a set of static (Shared in Visual Basic) services to maintain different types used in the ecosystem of an OPC UA Server.

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

## Methods

### Register

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

| Overload | Description |
|---|---|
| [Register(Assembly)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypes/members#register-system-reflection-assembly)<span class="api-meta">static</span> | Registers the types in the `assembly` specified. |
| [Register(IEnumerable&lt;Type&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypes/members#register-system-collections-generic-ienumerable-of-system-type)<span class="api-meta">static</span> | Registers the `types` specified. |
| [Register(Type, params Type\[\])](#register-system-type-system-type-array)<span class="api-meta">static</span> | Registers the `type` and the further specified `types`. |

#### Register(Assembly)

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

Registers the types in the `assembly` specified.

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

```csharp
public static void Register(Assembly assembly)
```

</div>

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

```vbnet
Public Shared Sub Register(assembly As Assembly)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `assembly` | [Assembly](https://learn.microsoft.com/dotnet/api/system.reflection.assembly) | The [Assembly](https://learn.microsoft.com/dotnet/api/system.reflection.assembly) its types are inspected regarding the OPC UA type specific characteristics and registers them accordingly. |

**Exceptions**

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

#### Register(IEnumerable&lt;Type&gt;)

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

Registers the `types` specified.

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

```csharp
public static void Register(IEnumerable<Type> types)
```

</div>

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

```vbnet
Public Shared Sub Register(types As IEnumerable(Of Type))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `types` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[Type](https://learn.microsoft.com/dotnet/api/system.type)&gt; | The sequence of [Type](https://learn.microsoft.com/dotnet/api/system.type) instances to inspect regarding the OPC UA type specific characteristics and registers them accordingly. |

**Exceptions**

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

**Remarks**

Any null reference (Nothing in Visual Basic) in `types` is ignored.

#### Register(Type, params Type\[\])

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

Registers the `type` and the further specified `types`.

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

```csharp
public static void Register(Type type, params Type[] types)
```

</div>

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

```vbnet
Public Shared Sub Register(type As Type, ParamArray types As Type())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [Type](https://learn.microsoft.com/dotnet/api/system.type) | The [Type](https://learn.microsoft.com/dotnet/api/system.type) instance to register. |
| `types` | params [Type](https://learn.microsoft.com/dotnet/api/system.type)[] | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) instances to inspect regarding the OPC UA type specific characteristics and registers them accordingly. |

**Exceptions**

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

**Remarks**

Any null reference (Nothing in Visual Basic) in `types` is ignored.

### Unregister

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

| Overload | Description |
|---|---|
| [Unregister(Assembly)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypes/members#unregister-system-reflection-assembly)<span class="api-meta">static</span> | Unregisters the types in the `assembly` specified. |
| [Unregister(IEnumerable&lt;Type&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctypes/members#unregister-system-collections-generic-ienumerable-of-system-type)<span class="api-meta">static</span> | Unregisters the `types` specified. |
| [Unregister(Type, params Type\[\])](#unregister-system-type-system-type-array)<span class="api-meta">static</span> | Unregisters the `type` and the further specified `types`. |

#### Unregister(Assembly)

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

Unregisters the types in the `assembly` specified.

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

```csharp
public static void Unregister(Assembly assembly)
```

</div>

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

```vbnet
Public Shared Sub Unregister(assembly As Assembly)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `assembly` | [Assembly](https://learn.microsoft.com/dotnet/api/system.reflection.assembly) | The [Assembly](https://learn.microsoft.com/dotnet/api/system.reflection.assembly) its types are unregistered accordingly. |

**Exceptions**

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

#### Unregister(IEnumerable&lt;Type&gt;)

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

Unregisters the `types` specified.

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

```csharp
public static void Unregister(IEnumerable<Type> types)
```

</div>

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

```vbnet
Public Shared Sub Unregister(types As IEnumerable(Of Type))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `types` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[Type](https://learn.microsoft.com/dotnet/api/system.type)&gt; | A sequence of [Type](https://learn.microsoft.com/dotnet/api/system.type) instances to unregister them accordingly. |

**Exceptions**

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

#### Unregister(Type, params Type\[\])

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

Unregisters the `type` and the further specified `types`.

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

```csharp
public static void Unregister(Type type, params Type[] types)
```

</div>

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

```vbnet
Public Shared Sub Unregister(type As Type, ParamArray types As Type())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [Type](https://learn.microsoft.com/dotnet/api/system.type) | The [Type](https://learn.microsoft.com/dotnet/api/system.type) instance to unregister. |
| `types` | params [Type](https://learn.microsoft.com/dotnet/api/system.type)[] | An array of [Type](https://learn.microsoft.com/dotnet/api/system.type) instances to unregister them accordingly. |

**Exceptions**

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

**Remarks**

Any null reference (Nothing in Visual Basic) in `types` is ignored.

## Events

### DecodingFailed

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

Occurs when the decoding has failed.

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

```csharp
public static event OpcTypeDecodingFailedEventHandler DecodingFailed
```

</div>

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

```vbnet
Public Shared Event DecodingFailed As OpcTypeDecodingFailedEventHandler
```

</div>

**Event type**

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

### EncodingFailed

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

Occurs when the encoding has failed.

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

```csharp
public static event OpcTypeEncodingFailedEventHandler EncodingFailed
```

</div>

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

```vbnet
Public Shared Event EncodingFailed As OpcTypeEncodingFailedEventHandler
```

</div>

**Event type**

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