Ejemplo n.º 1
0
 static public async Task OnOperationSelected(IDialogContext context, IAwaitable <IssueDataModel> result)
 {
     try
     {
         _issueSelected = await result;
         var child = new PromptConfirm(Resources.BOT_PROMPT_CONFIRM_CHOICE,
                                       Resources.BOT_PROMPT_CONFIRM_WRONG_CHOICE,
                                       Constant.MaxRetry, PromptStyle.Auto);
         context.Call(child, OnOperationConfirmed);
     }
     catch (TooManyAttemptsException)
     {
         context.Done(Resources.USER_DLG_BACK_TO_START);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Ask a yes/no questions.
        /// </summary>
        /// <param name="context"> The dialog context.</param>
        /// <param name="resume"> Resume handler.</param>
        /// <param name="promptOptions"> The options for the prompt, <see cref="PromptOptions{T}"/>.</param>
        public static void Confirm(IDialogContext context, ResumeAfter <bool> resume, PromptOptions <string> promptOptions)
        {
            var child = new PromptConfirm(promptOptions);

            context.Call <bool>(child, resume);
        }
Ejemplo n.º 3
0
 /// <summary>   Ask a yes/no question. </summary>
 /// <param name="context">  The context. </param>
 /// <param name="resume">   Resume handler. </param>
 /// <param name="prompt">   The prompt to show to the user. </param>
 /// <param name="retry">    What to show on retry. </param>
 /// <param name="attempts"> The number of times to retry. </param>
 public static void Confirm(IDialogContext context, ResumeAfter<bool> resume, string prompt, string retry = null, int attempts = 3)
 {
     var child = new PromptConfirm(prompt, retry, attempts);
     context.Call<bool>(child, resume);
 }