/// <summary>
        /// Initializes a new instance of the IntentDialog class
        /// </summary>
        /// <param name="dialogId"></param>
        /// <param name="intentFactory"></param>
        /// <param name="logger"></param>
        public IntentDialogBase(
            string dialogId,
            IIntentFactory intentFactory,
            IntentHandlerFactory intentHandlerFactory,
            OAuthDialog oAuthDialog,
            ILogger logger)
            : base(dialogId)
        {
            this.intentFactory        = intentFactory;
            this.intentHandlerFactory = intentHandlerFactory;
            this.logger = logger;

            // Add common prompts
            this.AddDialog(new TextPrompt(nameof(TextPrompt)));
            this.AddDialog(oAuthDialog);

            // Add main flow waterfall
            var warterfallSteps = new WaterfallStep[]
            {
                GetIntentStepAsync,
                GetUserInputStepAsync,
                ExecuteTaskStepAsync,
            };

            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), warterfallSteps));

            // Add children dialogs required by the intent factory
            foreach (var dialog in this.intentFactory.Dialogs)
            {
                AddDialog(dialog);
            }

            // Set the initial child Dialog to the waterfall dialog
            InitialDialogId = nameof(WaterfallDialog);
        }
Example #2
0
 /// <summary>
 /// Initializes a new LuisIntentDialog
 /// </summary>
 /// <param name="intentService"></param>
 /// <param name="intentFactory"></param>
 /// <param name="intentHandlerFactory"></param>
 /// <param name="logger"></param>
 public IntentDialog(
     IIntentService intentService,
     IIntentFactory intentFactory,
     IntentHandlerFactory intentHandlerFactory,
     OAuthDialog oAuthDialog,
     ILogger <IntentDialog> logger)
     : base(nameof(IntentDialog), intentFactory, intentHandlerFactory, oAuthDialog, logger)
 {
     this.intentService = intentService;
 }