# OpcMethodNode&lt;T&gt; Members

> Reference: Defines a generic method node.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcMethodNode&lt;T&gt;</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>
</dl>

Inherits members from [OpcMethodNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethodnode/members), [OpcInstanceNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcinstancenode/members), [OpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnode/members).

## Constructors

### OpcMethodNode

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

| Overload | Description |
|---|---|
| [OpcMethodNode(OpcName, T)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethodnode-1/members#opcmethodnode-opc-uafx-opcname-t0) | Initializes a new instance of the [OpcMethodNode&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethodnode-1/) class accessible by the `name` specified with the `T` call given by `callback`. |
| [OpcMethodNode(OpcName, OpcNodeId, T)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethodnode-1/members#opcmethodnode-opc-uafx-opcname-opc-uafx-opcnodeid-t0) | Initializes a new instance of the [OpcMethodNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethodnode/) class accessible by the `name` and `id` specified with the delegate to call given by `callback`. |
| [OpcMethodNode(IOpcNode, OpcName, T)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethodnode-1/members#opcmethodnode-opc-uafx-iopcnode-opc-uafx-opcname-t0) | Initializes a new instance of the [OpcMethodNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethodnode/) class accessible by the `name` specified with the `T` call given by `callback` as a child node of the `parent` node given. |
| [OpcMethodNode(IOpcNode, OpcName, OpcNodeId, T)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethodnode-1/members#opcmethodnode-opc-uafx-iopcnode-opc-uafx-opcname-opc-uafx-opcnodeid-t0) | Initializes a new instance of the [OpcMethodNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethodnode/) class accessible by the `name` and `id` specified with the delegate to call defined by `callback` as a child node of the `parent` node given. |

**Exceptions (all overloads)**

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

#### OpcMethodNode(OpcName, T)

Initializes a new instance of the [OpcMethodNode&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethodnode-1/) class accessible by the `name` specified with the `T` call given by `callback`.

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

```csharp
public OpcMethodNode(OpcName name, T callback)
```

</div>

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

```vbnet
Public Sub New(name As OpcName, callback As T)
```

</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/) through that the new method node can be accessed. |
| `callback` | T | The `T` to call on method invokation of the new method node. |

#### OpcMethodNode(OpcName, OpcNodeId, T)

Initializes a new instance of the [OpcMethodNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethodnode/) class accessible by the `name` and `id` specified with the delegate to call given by `callback`.

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

```csharp
public OpcMethodNode(OpcName name, OpcNodeId id, T callback)
```

</div>

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

```vbnet
Public Sub New(name As OpcName, id As OpcNodeId, callback As T)
```

</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/) through that the new method node can be accessed. |
| `id` | [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/) through that the new method node can be identified and accessed. |
| `callback` | T | The `T` to call on method invokation of the new method node. |

#### OpcMethodNode(IOpcNode, OpcName, T)

Initializes a new instance of the [OpcMethodNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethodnode/) class accessible by the `name` specified with the `T` call given by `callback` as a child node of the `parent` node given.

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

```csharp
public OpcMethodNode(IOpcNode parent, OpcName name, T callback)
```

</div>

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

```vbnet
Public Sub New(parent As IOpcNode, name As OpcName, callback As T)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `parent` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available. |
| `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/) through that the new method node can be accessed. |
| `callback` | T | The `T` to call on method invokation of the new method node. |

#### OpcMethodNode(IOpcNode, OpcName, OpcNodeId, T)

Initializes a new instance of the [OpcMethodNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethodnode/) class accessible by the `name` and `id` specified with the delegate to call defined by `callback` as a child node of the `parent` node given.

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

```csharp
public OpcMethodNode(IOpcNode parent, OpcName name, OpcNodeId id, T callback)
```

</div>

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

```vbnet
Public Sub New(
    parent As IOpcNode,
    name As OpcName,
    id As OpcNodeId,
    callback As T)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `parent` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available. |
| `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/) through that the new method node can be accessed. |
| `id` | [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/) through that the new method node can be identified and accessed. |
| `callback` | T | The `T` to call on method invokation of the new method node. |

## Properties

### Callback

Gets or sets the `T` of the method to invoke in case there this method node is called.

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

```csharp
public T Callback { get; set; }
```

</div>

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

```vbnet
Public Property Callback As T
```

</div>

**Property value**

T

The `T` to invoke on method call.
