Esempio n. 1
0
        public MainDialog(
            IServiceProvider serviceProvider)
            : base(nameof(MainDialog))
        {
            _settings        = serviceProvider.GetService <BotSettings>();
            _services        = serviceProvider.GetService <BotServices>();
            _templateManager = serviceProvider.GetService <LocaleTemplateManager>();

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

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

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

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

            // register dialog
            this.outgoingCallDialog = serviceProvider.GetService <OutgoingCallDialog>() ?? throw new ArgumentNullException(nameof(OutgoingCallDialog));
            AddDialog(outgoingCallDialog ?? throw new ArgumentNullException(nameof(outgoingCallDialog)));
        }
        public MainDialog(
            BotSettings settings,
            BotServices services,
            ResponseManager responseManager,
            ConversationState conversationState,
            OutgoingCallDialog outgoingCallDialog,
            IBotTelemetryClient telemetryClient)
            : base(nameof(MainDialog), telemetryClient)
        {
            this.outgoingCallDialog = outgoingCallDialog;
            _settings          = settings;
            _services          = services;
            _responseManager   = responseManager;
            _conversationState = conversationState;
            TelemetryClient    = telemetryClient;
            _stateAccessor     = _conversationState.CreateProperty <PhoneSkillState>(nameof(PhoneSkillState));

            AddDialog(outgoingCallDialog ?? throw new ArgumentNullException(nameof(outgoingCallDialog)));
        }