Example #1
0
 private static async Task <DialogTurnResult> AskTitleStepAsync(DialogContext dc, WaterfallStepContext step)
 {
     // Prompt for title if missing
     if (!step.Values.ContainsKey(AlarmTitle))
     {
         return(await dc.PromptAsync(TitlePrompt, "What would you like to call your alarm?").ConfigureAwait(false));
     }
     else
     {
         return(await step.NextAsync().ConfigureAwait(false));
     }
 }
Example #2
0
        private static async Task <DialogTurnResult> AskTimeStepAsync(DialogContext dc, WaterfallStepContext step)
        {
            // Save title if prompted for.
            if (step.Result != null)
            {
                step.Values[AlarmTitle] = step.Result;
            }

            // Prompt for time if missing.
            if (!step.Values.ContainsKey(AlarmTime))
            {
                return(await dc.PromptAsync(TimePrompt, $"What time would you like your '{step.Values[AlarmTitle]}' alarm set for?").ConfigureAwait(false));
            }
            else
            {
                return(await step.NextAsync().ConfigureAwait(false));
            }
        }