Method ExecuteMethod<T>
Namespace: Belay.Core
Assembly: Belay.Core.dll
ExecuteMethod<T>(IDeviceConnection, MethodInfo, object[], CancellationToken)
Executes a method with attribute-based Python code generation.
csharp
public static Task<T> ExecuteMethod<T>(IDeviceConnection device, MethodInfo method, object[] args, CancellationToken cancellationToken = default)
Parameters
device
IDeviceConnection
The device connection to execute on.
method
MethodInfo
The method info with attributes.
args
object[]
The method arguments.
cancellationToken
CancellationToken
Cancellation token for the operation.
Returns
Task<T>
The result of the method execution.
Type Parameters
T
The return type of the method.
ExecuteMethod(IDeviceConnection, MethodInfo, object[], CancellationToken)
Executes a method without return value (void/Task).
csharp
public static Task ExecuteMethod(IDeviceConnection device, MethodInfo method, object[] args, CancellationToken cancellationToken = default)
Parameters
device
IDeviceConnection
The device connection to execute on.
method
MethodInfo
The method info with attributes.
args
object[]
The method arguments.
cancellationToken
CancellationToken
Cancellation token for the operation.