# OpcMethodDelegateCommand Class

> Reference: Provides an implementation of the IOpcMethodCommand interface which delegates method evaluations and method calls to a set of callback routines.

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

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

Provides an implementation of the [IOpcMethodCommand](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcmethodcommand/) interface which delegates method evaluations and method calls to a set of callback routines.

## Syntax

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

```csharp
public class OpcMethodDelegateCommand
```

</div>

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

```vbnet
Public Class OpcMethodDelegateCommand
```

</div>

## Inheritance

[Object](https://learn.microsoft.com/dotnet/api/system.object) → **OpcMethodDelegateCommand**

## Implements

<ul class="api-implements">
<li><a href="../opc.uafx.iopcmethodcommand/">IOpcMethodCommand</a></li>
</ul>

## Constructors

| Name | Description |
|---|---|
| [OpcMethodDelegateCommand](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethoddelegatecommand/members#opcmethoddelegatecommand)<span class="api-meta">3 overloads</span> | Initializes a new instance of the OpcMethodDelegateCommand class using the `executeCallback` specified. |

## Methods

| Name | Description |
|---|---|
| [CanExecute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethoddelegatecommand/members#canexecute) | Determines the value of the [Executable](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#executable) attribute of the method ([CanExecute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethodnode/members#canexecute)) and therefore decides whether the [Execute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethoddelegatecommand/members#execute) method can be called in general to execute the method implementation. |
| [CanUserExecute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethoddelegatecommand/members#canuserexecute) | Determines the value of the [UserExecutable](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#userexecutable) attribute of the method ([CanUserExecute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethodnode/members#canuserexecute)) and therefore decides wether the [Execute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethoddelegatecommand/members#execute) method can be called by the current user to execute the method implementation. |
| [Execute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmethoddelegatecommand/members#execute) | Performs the tasks necessary to implement the logic associated with a specific method using the `context` and `inputArguments` specified. |

## Applies to

| Package | Versions |
|---|---|
| Opc.UaFx.Advanced | v2.9–v2.59 |
