Пример #1
0
        /// <summary>
        /// Creates a new instance of the root dialog
        /// </summary>
        /// <param name="userState">The state of the user dialog</param>
        /// <returns></returns>
        public RootDialog(
            StringResource stringResource,
            CareerAdviseRecognizer recognizer,
            KnowledgeBaseFactory factory,
            UserState userState) : base("root")
        {
            this.stringResource = stringResource;
            this.recognizer     = recognizer;
            this.userState      = userState;

            // Add the prompts
            AddDialog(new ChoicePrompt(MenuPrompt, ChoiceValidation));
            AddDialog(new KpmgCareerDialog(Companies.KPMG.ToString(), stringResource, recognizer, factory, userState));
            AddDialog(new TextPrompt(Companies.EY.ToString()));

            // Defines a simple two step Waterfall to test the slot dialog.
            AddDialog(new WaterfallDialog(MenuOptions, new WaterfallStep[]
            {
                MenuPromptAsync,
                ProcessResultsAsync,
                ResumeAsync
            }));

            InitialDialogId = MenuOptions;
        }
Пример #2
0
        public KpmgCareerDialog(
            string dialogId,
            StringResource stringResource,
            CareerAdviseRecognizer recognizer,
            KnowledgeBaseFactory factory,
            UserState userState) : base(dialogId)
        {
            this.stringResource = stringResource;
            this.recognizer     = recognizer;
            this.userState      = userState;
            this.qnaMaker       = factory?.CreateKpmgQnAMaker();

            // Add the prompts
            AddDialog(new ChoicePrompt(QuestionTypePrompt, ChoiceValidation));
            AddDialog(new TextPrompt(QuestionPrompt));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                PromptQuestionTypeAsync,
                QuestionTypePromptResultAsync,
                QuestionPromptResultAsync
            }));

            InitialDialogId = nameof(WaterfallDialog);
        }