Example #1
0
        public MainDialog(
            IServiceProvider serviceProvider,
            IBotTelemetryClient telemetryClient)
            : base(nameof(MainDialog))
        {
            _services       = serviceProvider.GetService <BotServices>();
            _templateEngine = serviceProvider.GetService <LocaleTemplateEngineManager>();
            TelemetryClient = telemetryClient;

            // Create conversation state properties
            var conversationState = serviceProvider.GetService <ConversationState>();

            _stateAccessor = conversationState.CreateProperty <SkillState>(nameof(SkillState));

            var steps = new WaterfallStep[]
            {
                IntroStepAsync,
                RouteStepAsync,
                FinalStepAsync,
            };

            AddDialog(new WaterfallDialog(nameof(MainDialog), steps));
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            InitialDialogId = nameof(MainDialog);

            // Register dialogs
            _sampleDialog = serviceProvider.GetService <SampleDialog>();
            _sampleAction = serviceProvider.GetService <SampleAction>();
            AddDialog(_sampleDialog);
            AddDialog(_sampleAction);
        }
Example #2
0
        public MainDialog(
            IServiceProvider serviceProvider,
            IBotTelemetryClient telemetryClient)
            : base(nameof(MainDialog), telemetryClient)
        {
            _services       = serviceProvider.GetService <BotServices>();
            _templateEngine = serviceProvider.GetService <LocaleTemplateEngineManager>();
            TelemetryClient = telemetryClient;

            // Create conversation state properties
            var conversationState = serviceProvider.GetService <ConversationState>();

            _stateAccessor = conversationState.CreateProperty <SkillState>(nameof(SkillState));

            // Register dialogs
            _sampleDialog = serviceProvider.GetService <SampleDialog>();
            AddDialog(_sampleDialog);
        }
Example #3
0
        public MainDialog(
            BotSettings settings,
            BotServices services,
            ResponseManager responseManager,
            UserState userState,
            ConversationState conversationState,
            SampleDialog sampleDialog,
            IBotTelemetryClient telemetryClient)
            : base(nameof(MainDialog), telemetryClient)
        {
            _settings        = settings;
            _services        = services;
            _responseManager = responseManager;
            TelemetryClient  = telemetryClient;

            // Initialize state accessor
            _stateAccessor   = conversationState.CreateProperty <SkillState>(nameof(SkillState));
            _contextAccessor = userState.CreateProperty <SkillContext>(nameof(SkillContext));

            // Register dialogs
            AddDialog(sampleDialog);
        }
        public MainDialog(
            IServiceProvider serviceProvider)
            : base(nameof(MainDialog))
        {
            _services       = serviceProvider.GetService <BotServices>();
            _templateEngine = serviceProvider.GetService <LocaleTemplateManager>();

            var steps = new WaterfallStep[]
            {
                IntroStepAsync,
                RouteStepAsync,
                FinalStepAsync,
            };

            AddDialog(new WaterfallDialog(nameof(MainDialog), steps));
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            InitialDialogId = nameof(MainDialog);

            // Register dialogs
            _sampleDialog = serviceProvider.GetService <SampleDialog>();
            _sampleAction = serviceProvider.GetService <SampleAction>();
            AddDialog(_sampleDialog);
            AddDialog(_sampleAction);
        }