Share via


DialogContext.CancelAllDialogsAsync Method

Definition

Overloads

CancelAllDialogsAsync(CancellationToken)

Deletes any existing dialog stack thus canceling all dialogs on the stack.

CancelAllDialogsAsync(Boolean, String, Object, CancellationToken)

Deletes any existing dialog stack thus canceling all dialogs on the stack.

CancelAllDialogsAsync(CancellationToken)

Deletes any existing dialog stack thus canceling all dialogs on the stack.

public System.Threading.Tasks.Task<Microsoft.Bot.Builder.Dialogs.DialogTurnResult> CancelAllDialogsAsync (System.Threading.CancellationToken cancellationToken = default);
member this.CancelAllDialogsAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.Dialogs.DialogTurnResult>
Public Function CancelAllDialogsAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of DialogTurnResult)

Parameters

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

A task that represents the work queued to execute.

Remarks

If the task is successful, the result indicates that dialogs were canceled after the turn was processed by the dialog or that the stack was already empty.

In general, the parent context is the dialog or bot turn handler that started the dialog. If the parent is a dialog, the stack calls the parent's ResumeDialogAsync(DialogContext, DialogReason, Object, CancellationToken) method to return a result to the parent dialog. If the parent dialog does not implement `ResumeDialogAsync`, then the parent will end, too, and the result is passed to the next parent context.

See also

Applies to

CancelAllDialogsAsync(Boolean, String, Object, CancellationToken)

Deletes any existing dialog stack thus canceling all dialogs on the stack.

public System.Threading.Tasks.Task<Microsoft.Bot.Builder.Dialogs.DialogTurnResult> CancelAllDialogsAsync (bool cancelParents, string eventName = default, object eventValue = default, System.Threading.CancellationToken cancellationToken = default);
member this.CancelAllDialogsAsync : bool * string * obj * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.Dialogs.DialogTurnResult>
Public Function CancelAllDialogsAsync (cancelParents As Boolean, Optional eventName As String = Nothing, Optional eventValue As Object = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of DialogTurnResult)

Parameters

cancelParents
Boolean

If true the cancellation will bubble up through any parent dialogs as well.

eventName
String

The event.

eventValue
Object

The event value.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

A task that represents the work queued to execute.

Remarks

If the task is successful, the result indicates that dialogs were canceled after the turn was processed by the dialog or that the stack was already empty.

In general, the parent context is the dialog or bot turn handler that started the dialog. If the parent is a dialog, the stack calls the parent's ResumeDialogAsync(DialogContext, DialogReason, Object, CancellationToken) method to return a result to the parent dialog. If the parent dialog does not implement `ResumeDialogAsync`, then the parent will end, too, and the result is passed to the next parent context.

See also

Applies to