public TestSumDialog(DemoUserStateAccessors userStateAccessor) : base(nameof(TestSumDialog))
        {
            this.userStateAccessor = userStateAccessor;

            var steps = new WaterfallStep[]
            {
                this.PromptForFirstNumberAsync,
                this.PromptForSecondNumberAsync,
                this.AcknowledgeNumberAsync,
            };

            this.AddDialog(new WaterfallDialog(MainDialogName, steps));
            this.AddDialog(new NumberPrompt <int>(ChooseNumberDialogName, this.NumberValidatorAsync));
        }
Beispiel #2
0
        public DemoBot(
            DemoUserStateAccessors demoUserStateAccessor,
            DemoDialogStateAccessors demoDialogStateAccessor,
            IRoomService roomService)
        {
            this.demoUserStateAccessor   = demoUserStateAccessor ?? throw new ArgumentNullException(nameof(demoUserStateAccessor));
            this.demoDialogStateAccessor = demoDialogStateAccessor ??
                                           throw new ArgumentNullException(nameof(demoDialogStateAccessor));

            this.dialogs = new DialogSet(demoDialogStateAccessor.DialogStateAccessor);
            this.dialogs.Add(new TestChoicePromptDialog(this.demoUserStateAccessor));
            this.dialogs.Add(new TestCardsDialog());
            this.dialogs.Add(new TestGreetingDialog(this.demoUserStateAccessor));
            this.dialogs.Add(new TestSumDialog(this.demoUserStateAccessor));
            this.dialogs.Add(new TestRoomDialog(roomService));
        }
Beispiel #3
0
        public TestGreetingDialog(DemoUserStateAccessors userStateAccessor)
            : base(nameof(TestGreetingDialog))
        {
            this.userStateAccessor = userStateAccessor;

            WaterfallStep[] steps =
            {
                this.PromptForNameAsync,
                this.PromptForAgeAsync,
                this.WelcomeUserAsync,
            };

            this.AddDialog(new WaterfallDialog(GreetingDialog, steps));
            this.AddDialog(new TextPrompt(NamePrompt));
            this.AddDialog(new NumberPrompt <int>(AgePrompt));
        }
Beispiel #4
0
        public TestChoicePromptDialog(DemoUserStateAccessors userStateAccessor)
            : base(nameof(TestChoicePromptDialog))
        {
            this.userStateAccessor = userStateAccessor;

            WaterfallStep[] steps =
            {
                this.PromptForFavoriteColorAsync,
                this.PromptForFavoriteFruitAsync,
                this.AcknowledgeFavoriteColorAsync,
            };

            this.AddDialog(new WaterfallDialog(FavoriteColorDialog, steps));
            this.AddDialog(new ChoicePrompt(ColorPrompt)
            {
                Style = ListStyle.SuggestedAction
            });
            this.AddDialog(new ChoicePrompt(FruitPrompt)
            {
                Style = ListStyle.Inline
            });
        }