Ejemplo n.º 1
0
        public MainDialog(AddressDialogs addressDialog, HistoryDialog historyDialog, ReservationDialog reservationDialog) : base(nameof(MainDialog))
        {
            AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(addressDialog);
            AddDialog(historyDialog);
            AddDialog(reservationDialog);
            AddDialog(new WaterfallDialog(
                          nameof(WaterfallDialog),
                          new WaterfallStep[] { FirstStepAsync, ChooseStepAsync, MiddleStepAsync, FinalStepAscnc }));

            InitialDialogId = nameof(WaterfallDialog);
        }
        public ReservationDialog(UserState userState, AddressDialogs addressDialog, ISchedulerFactory schedulerFactory, EGRepository <Schedule> schedRepo, ConcurrentDictionary <string, ConversationReference> conversationReferences) : base(nameof(ReservationDialog))
        {
            _userProfileAccessor    = userState.CreateProperty <Schedule>("Schedule");
            _schedulerFactory       = schedulerFactory;
            _schedRepo              = schedRepo;
            _conversationReferences = conversationReferences;
            var waterfallSteps = new WaterfallStep[]
            {
                CreateReservationAdaptive,
                OrderSourceAdaptive,
                GetMenuFromSource,
                StoreMenuData
            };

            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), waterfallSteps));
            AddDialog(addressDialog);
            AddDialog(new TextPrompt("DateTimeInput", DateTimeValidatorAsync));
            AddDialog(new TextPrompt(nameof(TextPrompt)));

            InitialDialogId = nameof(WaterfallDialog);
        }