# OpcContext Members

> Reference: Provides information and services about the system which belong to the current situation (process, thread, session, etc.).

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

### Current

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

Gets or sets the [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) for the current thread.

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

```csharp
public static OpcContext Current { get; }
```

</div>

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

```vbnet
Public Shared ReadOnly Property Current As OpcContext
```

</div>

**Property value**

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

The [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) that represents the context of the current thread.

### Empty

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

Gets an empty [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) which can be used in cases there a session nor system specific context is not necessarily required.

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

```csharp
public static OpcContext Empty { get; }
```

</div>

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

```vbnet
Public Shared ReadOnly Property Empty As OpcContext
```

</div>

**Property value**

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

An instance of the [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) class without any contextual information.

### Identity

Gets the [OpcUserIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcuseridentity/) which belongs to the situation represented.

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

```csharp
public OpcUserIdentity Identity { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Identity As OpcUserIdentity
```

</div>

**Property value**

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

The [OpcUserIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcuseridentity/) which belongs to the situation represented or a null reference (Nothing in Visual Basic) if there is no identity information available.

### Namespaces

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

Gets a read-only collection of namespaces valid in the current [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/).

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

```csharp
public OpcReadOnlyNamespaceCollection Namespaces { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Namespaces As OpcReadOnlyNamespaceCollection
```

</div>

**Property value**

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

An instance of the [OpcReadOnlyNamespaceCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadonlynamespacecollection/) class with [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/) items for each 'NamespaceUri' used to organize the nodes in an address space.

### NodeIdFactory

Gets the [OpcNodeIdFactory](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeidfactory/) used to create new node identifiers using this context.

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

```csharp
public OpcNodeIdFactory NodeIdFactory { get; }
```

</div>

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

```vbnet
Public ReadOnly Property NodeIdFactory As OpcNodeIdFactory
```

</div>

**Property value**

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

The [OpcNodeIdFactory](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeidfactory/) used through this context or a null reference (Nothing in Visual Basic) if there is not node identifier factory associated with this context.

### Owner

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

Gets the owner of the current [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/).

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

```csharp
public IOpcApplicationInstance Owner { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Owner As IOpcApplicationInstance
```

</div>

**Property value**

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

An instance implementing the [IOpcApplicationInstance](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcapplicationinstance/) interface which has defined the current [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/).

### PreferredLocales

<span class="api-meta">virtual · since v2.11</span>

Gets a collection of preferred locales (see [Name](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo.name)) to use to localize data and information.

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

```csharp
public virtual OpcLocaleCollection PreferredLocales { get; }
```

</div>

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

```vbnet
Public Overridable ReadOnly Property PreferredLocales As OpcLocaleCollection
```

</div>

**Property value**

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

An instance of the [OpcLocaleCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opclocalecollection/) class with [Name](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo.name)s of the cultures to use to localize data and information in order of this [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/).

### SessionId

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

Gets the session identifier which identifies the session within that the context has been created and is valid.

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

```csharp
public virtual OpcNodeId SessionId { get; }
```

</div>

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

```vbnet
Public Overridable ReadOnly Property SessionId As OpcNodeId
```

</div>

**Property value**

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

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

## Methods

### Enter

<span class="api-meta">static · 2 overloads · since v2.40</span>

| Overload | Description |
|---|---|
| [Enter(params OpcNamespace\[\])](#enter-opc-uafx-opcnamespace-array)<span class="api-meta">static · since v2.40</span> | Enters a new [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) using the `namespaces` specified. |
| [Enter(IEnumerable&lt;OpcNamespace&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/members#enter-system-collections-generic-ienumerable-of-opc-uafx-opcnamespace)<span class="api-meta">static · since v2.40</span> | Enters a new [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) using the `namespaces` specified. |

#### Enter(params OpcNamespace\[\])

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

Enters a new [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) using the `namespaces` specified.

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

```csharp
public static OpcContext.Local Enter(params OpcNamespace[] namespaces)
```

</div>

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

```vbnet
Public Shared Function Enter(
    ParamArray namespaces As OpcNamespace()) As OpcContext.Local
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `namespaces` | params [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/)[] | An array of [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/) instances known by the [Namespaces](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/members#namespaces) of the new [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) to create. |

**Returns**

[OpcContext.Local](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext.local/)

A new instance of the [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) class.

#### Enter(IEnumerable&lt;OpcNamespace&gt;)

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

Enters a new [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) using the `namespaces` specified.

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

```csharp
public static OpcContext.Local Enter(IEnumerable<OpcNamespace> namespaces)
```

</div>

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

```vbnet
Public Shared Function Enter(
    namespaces As IEnumerable(Of OpcNamespace)) As OpcContext.Local
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `namespaces` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/)&gt; | A sequence of [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/) instances known by the [Namespaces](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/members#namespaces) of the new [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) to create. |

**Returns**

[OpcContext.Local](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext.local/)

A new instance of the [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) class.

### GetDataType

<span class="api-meta">6 overloads · since v2.22</span>

| Overload | Description |
|---|---|
| [GetDataType(string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/members#getdatatype-system-string)<span class="api-meta">since v2.22</span> | Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object which is known under the `name` specified. |
| [GetDataType(OpcName)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/members#getdatatype-opc-uafx-opcname)<span class="api-meta">since v2.22</span> | Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object which is known under the `name` specified. |
| [GetDataType(OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/members#getdatatype-opc-uafx-opcnodeid)<span class="api-meta">since v2.22</span> | Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object which declares the type which is identified by the `typeId` specified. |
| [GetDataType(Type)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/members#getdatatype-system-type)<span class="api-meta">since v2.22</span> | Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object which declares the type implemented by the `underlyingType` specified. |
| [GetDataType(OpcEncoding)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/members#getdatatype-opc-uafx-opcencoding)<span class="api-meta">since v2.22</span> | Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object which declares the type which is identified by the `encoding` specified. |
| [GetDataType(XmlQualifiedName)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/members#getdatatype-system-xml-xmlqualifiedname)<span class="api-meta">since v2.22</span> | Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object which is known under the `xmlName` specified. |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [ObjectDisposedException](https://learn.microsoft.com/dotnet/api/system.objectdisposedexception) | The object has been disposed of. |

#### GetDataType(string)

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

Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object which is known under the `name` specified.

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

```csharp
public OpcDataTypeInfo GetDataType(string name)
```

</div>

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

```vbnet
Public Function GetDataType(name As String) As OpcDataTypeInfo
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `name` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The [string](https://learn.microsoft.com/dotnet/api/system.string) to use to identify the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object to retrieve. |

**Returns**

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

The [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object its [Name](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/members#name) is equals (regarding its [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/members#value)) to the `name` specified; otherwise a null reference (Nothing in Visual Basic).

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `name` is equals [Empty](https://learn.microsoft.com/dotnet/api/system.string.empty). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `name` is a null reference (Nothing in Visual Basic). |

#### GetDataType(OpcName)

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

Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object which is known under the `name` specified.

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

```csharp
public OpcDataTypeInfo GetDataType(OpcName name)
```

</div>

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

```vbnet
Public Function GetDataType(name As OpcName) As OpcDataTypeInfo
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) of the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object to retrieve. |

**Returns**

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

The [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object its [Name](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/members#name) is equals to the `name` specified; otherwise a null reference (Nothing in Visual Basic).

**Exceptions**

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

#### GetDataType(OpcNodeId)

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

Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object which declares the type which is identified by the `typeId` specified.

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

```csharp
public OpcDataTypeInfo GetDataType(OpcNodeId typeId)
```

</div>

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

```vbnet
Public Function GetDataType(typeId As OpcNodeId) As OpcDataTypeInfo
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `typeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) to retrieve. |

**Returns**

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

The [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object which is known under the `typeId` specified or a null reference (Nothing in Visual Basic) if there doesn't exist a known [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object which is associated with the `typeId` specified.

**Exceptions**

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

#### GetDataType(Type)

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

Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object which declares the type implemented by the `underlyingType` specified.

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

```csharp
public OpcDataTypeInfo GetDataType(Type underlyingType)
```

</div>

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

```vbnet
Public Function GetDataType(underlyingType As Type) As OpcDataTypeInfo
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `underlyingType` | [Type](https://learn.microsoft.com/dotnet/api/system.type) | The [Type](https://learn.microsoft.com/dotnet/api/system.type) which implements the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) to retrieve. |

**Returns**

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

The [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object which declares the `underlyingType` specified or a null reference (Nothing in Visual Basic) if there isn't a [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object associated with the `underlyingType` specified.

**Exceptions**

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

#### GetDataType(OpcEncoding)

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

Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object which declares the type which is identified by the `encoding` specified.

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

```csharp
public OpcDataTypeInfo GetDataType(OpcEncoding encoding)
```

</div>

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

```vbnet
Public Function GetDataType(encoding As OpcEncoding) As OpcDataTypeInfo
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `encoding` | [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/) which identifies the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) to retrieve. |

**Returns**

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

The [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object which is known under the `encoding` specified or a null reference (Nothing in Visual Basic) if there doesn't exist a known [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) which is associated with the `encoding` specified.

**Exceptions**

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

#### GetDataType(XmlQualifiedName)

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

Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object which is known under the `xmlName` specified.

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

```csharp
public OpcDataTypeInfo GetDataType(XmlQualifiedName xmlName)
```

</div>

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

```vbnet
Public Function GetDataType(xmlName As XmlQualifiedName) As OpcDataTypeInfo
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `xmlName` | [XmlQualifiedName](https://learn.microsoft.com/dotnet/api/system.xml.xmlqualifiedname) | The [XmlQualifiedName](https://learn.microsoft.com/dotnet/api/system.xml.xmlqualifiedname) of the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object to retrieve. |

**Returns**

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

The [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object its [XmlName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/members#xmlname) is equals to the `xmlName` specified; otherwise a null reference (Nothing in Visual Basic).

**Exceptions**

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

### GetNodeType

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

| Overload | Description |
|---|---|
| [GetNodeType(string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/members#getnodetype-system-string)<span class="api-meta">since v2.50</span> | Retrieves the [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) object which is known under the `name` specified. |
| [GetNodeType(OpcName)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/members#getnodetype-opc-uafx-opcname)<span class="api-meta">since v2.50</span> | Retrieves the [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) object which is known under the `name` specified. |
| [GetNodeType(OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/members#getnodetype-opc-uafx-opcnodeid)<span class="api-meta">since v2.50</span> | Retrieves the [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) object which declares the type which is identified by the `typeId` specified. |
| [GetNodeType(Type)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/members#getnodetype-system-type)<span class="api-meta">since v2.50</span> | Retrieves the [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) object which declares the type implemented by the `underlyingType` specified. |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [ObjectDisposedException](https://learn.microsoft.com/dotnet/api/system.objectdisposedexception) | The object has been disposed of. |

#### GetNodeType(string)

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

Retrieves the [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) object which is known under the `name` specified.

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

```csharp
public OpcNodeTypeInfo GetNodeType(string name)
```

</div>

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

```vbnet
Public Function GetNodeType(name As String) As OpcNodeTypeInfo
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `name` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The [string](https://learn.microsoft.com/dotnet/api/system.string) to use to identify the [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) object to retrieve. |

**Returns**

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

The [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) object its [Name](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/members#name) is equals (regarding its [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/members#value)) to the `name` specified; otherwise a null reference (Nothing in Visual Basic).

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `name` is equals [Empty](https://learn.microsoft.com/dotnet/api/system.string.empty). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `name` is a null reference (Nothing in Visual Basic). |

#### GetNodeType(OpcName)

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

Retrieves the [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) object which is known under the `name` specified.

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

```csharp
public OpcNodeTypeInfo GetNodeType(OpcName name)
```

</div>

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

```vbnet
Public Function GetNodeType(name As OpcName) As OpcNodeTypeInfo
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) of the [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) object to retrieve. |

**Returns**

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

The [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) object its [Name](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/members#name) is equals to the `name` specified; otherwise a null reference (Nothing in Visual Basic).

**Exceptions**

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

#### GetNodeType(OpcNodeId)

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

Retrieves the [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) object which declares the type which is identified by the `typeId` specified.

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

```csharp
public OpcNodeTypeInfo GetNodeType(OpcNodeId typeId)
```

</div>

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

```vbnet
Public Function GetNodeType(typeId As OpcNodeId) As OpcNodeTypeInfo
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `typeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) to retrieve. |

**Returns**

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

The [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) object which is known under the `typeId` specified or a null reference (Nothing in Visual Basic) if there doesn't exist a known [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) object which is associated with the `typeId` specified.

**Exceptions**

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

#### GetNodeType(Type)

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

Retrieves the [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) object which declares the type implemented by the `underlyingType` specified.

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

```csharp
public OpcNodeTypeInfo GetNodeType(Type underlyingType)
```

</div>

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

```vbnet
Public Function GetNodeType(underlyingType As Type) As OpcNodeTypeInfo
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `underlyingType` | [Type](https://learn.microsoft.com/dotnet/api/system.type) | The [Type](https://learn.microsoft.com/dotnet/api/system.type) which implements the [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) to retrieve. |

**Returns**

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

The [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) object which declares the `underlyingType` specified or a null reference (Nothing in Visual Basic) if there isn't a [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) object associated with the `underlyingType` specified.

**Exceptions**

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

### OfNode

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

Creates a context for the `node` specified which uses the information of the current [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/).

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

```csharp
public OpcNodeContext OfNode(OpcNode node)
```

</div>

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

```vbnet
Public Function OfNode(node As OpcNode) As OpcNodeContext
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `node` | [OpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnode/) | The [OpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnode/) to that the new context belongs. |

**Returns**

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

A new instance of the [OpcNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodecontext/) class for the `node`.

**Exceptions**

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