コード例 #1
0
 protected virtual async Task OnDialogEndAsync(DialogContext dc, DialogReason reason, CancellationToken cancellationToken = default(CancellationToken))
 {
     if (reason == DialogReason.CancelCalled)
     {
         await dc.CancelAllAsync(cancellationToken).ConfigureAwait(false);
     }
 }
コード例 #2
0
 protected virtual async Task OnDialogEndAsync(DialogContext dc, DialogReason reason)
 {
     if (reason == DialogReason.CancelCalled)
     {
         await dc.CancelAllAsync().ConfigureAwait(false);
     }
 }
コード例 #3
0
        public override async Task DialogEndAsync(ITurnContext turnContext, DialogInstance instance, DialogReason reason, CancellationToken cancellationToken = default(CancellationToken))
        {
            // Forward cancel to inner dialogs
            if (reason == DialogReason.CancelCalled)
            {
                var dialogState = (DialogState)instance.State[PersistedDialogState];
                var innerDc     = new DialogContext(_dialogs, turnContext, dialogState);
                await innerDc.CancelAllAsync(cancellationToken).ConfigureAwait(false);
            }

            await OnDialogEndAsync(turnContext, instance, reason, cancellationToken).ConfigureAwait(false);
        }