Esempio n. 1
0
        public async Task <DialogTurnResult> FinishOnboardingDialog(WaterfallStepContext sc, CancellationToken cancellationToken)
        {
            _state = await _accessor.GetAsync(sc.Context);

            _state.Location = (string)sc.Result;

            await _responder.ReplyWith(sc.Context, ExperiencesResponses.ResponseIds.HaveLocationMessage, new { _state.Name, _state.Location });

            return(await sc.EndDialogAsync());
        }
Esempio n. 2
0
        public async Task <DialogTurnResult> AskForLocation(WaterfallStepContext sc, CancellationToken cancellationToken)
        {
            _state = await _accessor.GetAsync(sc.Context, () => new ExperiencesState());

            var email = _state.Email = (string)sc.Result;

            await _responder.ReplyWith(sc.Context, ExperiencesResponses.ResponseIds.HaveEmailMessage, new { email });

            return(await sc.PromptAsync(DialogIds.LocationPrompt, new PromptOptions()
            {
                Prompt = await _responder.RenderTemplate(sc.Context, sc.Context.Activity.Locale, ExperiencesResponses.ResponseIds.LocationPrompt),
            }));
        }
Esempio n. 3
0
        public async Task <DialogTurnResult> AskForName(WaterfallStepContext sc, CancellationToken cancellationToken)
        {
            _state = await _accessor.GetAsync(sc.Context, () => new ExperiencesState());

            if (!string.IsNullOrEmpty(_state.Name))
            {
                return(await sc.NextAsync(_state.Name));
            }
            else
            {
                return(await sc.PromptAsync(DialogIds.NamePrompt, new PromptOptions()
                {
                    Prompt = await _responder.RenderTemplate(sc.Context, sc.Context.Activity.Locale, ExperiencesResponses.ResponseIds.NamePrompt),
                }));
            }
        }