Skip to content

Reference

OpcMethodDelegateCommand Members

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

Reference

OpcMethodDelegateCommand Members ​

Type
OpcMethodDelegateCommand
Namespace
Opc.UaFx
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0

Constructors ​

OpcMethodDelegateCommand ​

3 overloads

OverloadDescription
OpcMethodDelegateCommand(OpcMethodExecuteCallback)Initializes a new instance of the OpcMethodDelegateCommand class using the executeCallback specified.
OpcMethodDelegateCommand(OpcMethodExecuteCallback, OpcMethodCanExecuteCallback)Initializes a new instance of the OpcMethodDelegateCommand class using the executeCallback and canExecuteCallback specified.
OpcMethodDelegateCommand(OpcMethodExecuteCallback, OpcMethodCanExecuteCallback, OpcMethodCanExecuteCallback)Initializes a new instance of the OpcMethodDelegateCommand class using the executeCallback, canExecuteCallback and canUserExecuteCallback specified.

OpcMethodDelegateCommand(OpcMethodExecuteCallback) ​

Initializes a new instance of the OpcMethodDelegateCommand class using the executeCallback specified.

csharp
public OpcMethodDelegateCommand(OpcMethodExecuteCallback executeCallback)
vbnet
Public Sub New(executeCallback As OpcMethodExecuteCallback)

Parameters

NameTypeDescription
executeCallbackOpcMethodExecuteCallbackThe OpcMethodExecuteCallback which is invoked whenever the method of this command is called.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe executeCallback is a null reference (Nothing in Visual Basic).

OpcMethodDelegateCommand(OpcMethodExecuteCallback, OpcMethodCanExecuteCallback) ​

Initializes a new instance of the OpcMethodDelegateCommand class using the executeCallback and canExecuteCallback specified.

csharp
public OpcMethodDelegateCommand(
    OpcMethodExecuteCallback executeCallback,
    OpcMethodCanExecuteCallback canExecuteCallback)
vbnet
Public Sub New(
    executeCallback As OpcMethodExecuteCallback,
    canExecuteCallback As OpcMethodCanExecuteCallback)

Parameters

NameTypeDescription
executeCallbackOpcMethodExecuteCallbackThe OpcMethodExecuteCallback which is invoked whenever the canExecuteCallback evaluates to the value true as soon as the method of this command is called.
canExecuteCallbackOpcMethodCanExecuteCallbackThe OpcMethodCanExecuteCallback which is used to evaluate whether the method of this command can be called in general and by the current user.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe executeCallback or canExecuteCallback is a null reference (Nothing in Visual Basic).

OpcMethodDelegateCommand(OpcMethodExecuteCallback, OpcMethodCanExecuteCallback, OpcMethodCanExecuteCallback) ​

Initializes a new instance of the OpcMethodDelegateCommand class using the executeCallback, canExecuteCallback and canUserExecuteCallback specified.

csharp
public OpcMethodDelegateCommand(
    OpcMethodExecuteCallback executeCallback,
    OpcMethodCanExecuteCallback canExecuteCallback,
    OpcMethodCanExecuteCallback canUserExecuteCallback)
vbnet
Public Sub New(
    executeCallback As OpcMethodExecuteCallback,
    canExecuteCallback As OpcMethodCanExecuteCallback,
    canUserExecuteCallback As OpcMethodCanExecuteCallback)

Parameters

NameTypeDescription
executeCallbackOpcMethodExecuteCallbackThe OpcMethodExecuteCallback which is invoked whenever the canExecuteCallback and canUserExecuteCallback evaluate to the value true as soons as the method of this command is called.
canExecuteCallbackOpcMethodCanExecuteCallbackThe OpcMethodCanExecuteCallback which is used to evaluate whether the method of this command can be called in general.
canUserExecuteCallbackOpcMethodCanExecuteCallbackThe OpcMethodCanExecuteCallback which is used to evaluate whether the method of this command can be called by the current user.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe executeCallback, canExecuteCallback or canUserExecuteCallback is a null reference (Nothing in Visual Basic).

Methods ​

CanExecute ​

Determines the value of the Executable attribute of the method (CanExecute) and therefore decides whether the Execute method can be called in general to execute the method implementation.

csharp
public bool CanExecute(OpcContext context)
vbnet
Public Function CanExecute(context As OpcContext) As Boolean

Parameters

NameTypeDescription
contextOpcContextThe OpcReadAttributeValueContext in case there the Executable attribute is read or the OpcMethodContext in case there the method call is to be processed.

Returns

Boolean

The value true if the method can be called; otherwise the value false.

Implements

CanExecute

CanUserExecute ​

Determines the value of the UserExecutable attribute of the method (CanUserExecute) and therefore decides wether the Execute method can be called by the current user to execute the method implementation.

csharp
public bool CanUserExecute(OpcContext context)
vbnet
Public Function CanUserExecute(context As OpcContext) As Boolean

Parameters

NameTypeDescription
contextOpcContextThe OpcReadAttributeValueContext in case there the UserExecutable attribute is read or the OpcMethodContext in case there the method call is to be processed.

Returns

Boolean

The value true if the method can be called; otherwise the value false.

Implements

CanUserExecute

Execute ​

Performs the tasks necessary to implement the logic associated with a specific method using the context and inputArguments specified.

csharp
public void Execute(
    OpcMethodContext context,
    IList<object> inputArguments,
    IList<object> outputArguments)
vbnet
Public Sub Execute(
    context As OpcMethodContext,
    inputArguments As IList(Of Object),
    outputArguments As IList(Of Object))

Parameters

NameTypeDescription
contextOpcMethodContextThe OpcMethodContext which provides the contextual information required to execute the method.
inputArgumentsIList<Object>The generic list of object values to use / respect during the execution of the method.
outputArgumentsIList<Object>The generic list of object values to use for out, ref (in Visual Basic ByRef) and returned values.

Implements

Execute

Remarks

Any OPC UA related result information is to be set using the Result property of the context.

This method is (to be) only called after the call to CanExecute and CanUserExecute evaluates to the value true.