Table of Contents

Method CancelWith

Namespace
MaaFramework.Binding
Assembly
MaaFramework.Binding.dll

CancelWith(CancellationToken, Func<bool>?, Task<bool>?, MaaJob?)

Cancels the agent operation with a specified token.

bool CancelWith(CancellationToken cancellationToken, Func<bool>? waitFunc = null, Task<bool>? waitTask = null, MaaJob? waitJob = null)

Parameters

cancellationToken CancellationToken

The token used to cancel the waiting operation.

waitFunc Func<bool>?

The func that needs to be canceled.

waitTask Task<bool>?

The task that needs to be canceled.

waitJob MaaJob?

The job that needs to be canceled.

Returns

bool

The return value of waitFunc AND waitTask.Result AND waitJob.IsSucceeded().