Пример #1
0
        public EchoDialog(ChatbotAccessors accessors, string dialogId)
            : base(dialogId)
        {
            Accessors = accessors;
            WaterfallStep[] steps = new WaterfallStep[] {
                EchoAsync
            };

            AddDialog(new WaterfallDialog(WaterfallDialogName, steps));
        }
Пример #2
0
        public WelcomeDialog(ChatbotAccessors accessors, string dialogId)
            : base(dialogId)
        {
            Accessors = accessors;
            WaterfallStep[] steps = new WaterfallStep[] {
                PromptAsync,
                ReceiveResponseAsync
            };

            AddDialog(new WaterfallDialog(WaterfallDialogName, steps));
            AddDialog(new TextPrompt(TextPromptName));
        }
Пример #3
0
        public MainDialog(ConversationState conversationState, UserState userState)
            : base(nameof(MainDialog))
        {
            ConversationState = conversationState;
            UserState         = userState;
            Accessors         = new ChatbotAccessors(conversationState: ConversationState as ConversationState,
                                                     userState: UserState as UserState)
            {
                ConversationStateImplAccessor = ConversationState.CreateProperty <ConversationStateImpl>
                                                    (ChatbotAccessors.ConversationStateImplName),
                UserStateImplAccessor = UserState.CreateProperty <UserStateImpl>
                                            (ChatbotAccessors.UserStateImplName)
            };

            WaterfallStep[] steps = new WaterfallStep[] {
                RouteAsync,
                RefreshAsync
            };

            AddDialog(new WaterfallDialog(WaterfallDialogName, steps));
            AddDialog(new WelcomeDialog(Accessors, DialogTypes.Welcome.ToString()));
            AddDialog(new EchoDialog(Accessors, DialogTypes.Echo.ToString()));
        }