Exemple #1
0
        // Dependency injection uses this constructor to instantiate MainDialog
        public MainDialog(IVRRecognizer luisRecognizer, VoiceFactory voiceFactory, CustomerDialog customerDialog, NearestStoreDialog nearestStoreDialog, OrderStatusDialog orderStatusDialog, EmployeeDialog employeeDialog, PurchaseOrderStatusDialog purchaseOrderStatusDialog, LeavePolicyDialog leavePolicyDialog, ILogger <MainDialog> logger)
            : base(nameof(MainDialog))
        {
            _luisRecognizer = luisRecognizer;
            VoiceFactory    = voiceFactory;
            Logger          = logger;

            AddDialog(new OrderNumberPrompt());
            AddDialog(new PurchaseOrderNumberPrompt());
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));

            AddDialog(new WaterfallDialog("DTMF", new WaterfallStep[]
            {
                DTMFIntroStepAsync,
                DTMFActStepAsync
            }));

            AddDialog(customerDialog);
            AddDialog(nearestStoreDialog);
            AddDialog(orderStatusDialog);

            AddDialog(employeeDialog);
            AddDialog(purchaseOrderStatusDialog);
            AddDialog(leavePolicyDialog);

            // The initial child Dialog to run.
            InitialDialogId = "DTMF";
        }
        public EmployeeDialog(IVRRecognizer luisRecognizer, VoiceFactory voiceFactory, ILogger <MainDialog> logger)
            : base(nameof(EmployeeDialog))
        {
            _luisRecognizer = luisRecognizer;
            Logger          = logger;
            VoiceFactory    = voiceFactory;

            AddStep(IntroStepAsync);
            AddStep(ActStepAsync);
            AddStep(FinalStepAsync);
        }