예제 #1
0
        public MainDialog(
            BotSettings settings,
            BotServices services,
            ResponseManager responseManager,
            ConversationState conversationState,
            UserState userState,
            ForwardEmailDialog forwardEmailDialog,
            SendEmailDialog sendEmailDialog,
            ShowEmailDialog showEmailDialog,
            ReplyEmailDialog replyEmailDialog,
            DeleteEmailDialog deleteEmailDialog,
            IBotTelemetryClient telemetryClient)
            : base(nameof(MainDialog), telemetryClient)
        {
            _settings          = settings;
            _services          = services;
            _userState         = userState;
            _responseManager   = responseManager;
            _conversationState = conversationState;
            TelemetryClient    = telemetryClient;
            _stateAccessor     = _conversationState.CreateProperty <EmailSkillState>(nameof(EmailSkillState));

            AddDialog(forwardEmailDialog ?? throw new ArgumentNullException(nameof(forwardEmailDialog)));
            AddDialog(sendEmailDialog ?? throw new ArgumentNullException(nameof(sendEmailDialog)));
            AddDialog(showEmailDialog ?? throw new ArgumentNullException(nameof(showEmailDialog)));
            AddDialog(replyEmailDialog ?? throw new ArgumentNullException(nameof(replyEmailDialog)));
            AddDialog(deleteEmailDialog ?? throw new ArgumentNullException(nameof(deleteEmailDialog)));

            GetReadingDisplayConfig();
        }
        public MainDialog(
            IServiceProvider serviceProvider,
            IBotTelemetryClient telemetryClient)
            : base(nameof(MainDialog), telemetryClient)
        {
            _settings          = serviceProvider.GetService <BotSettings>();
            _services          = serviceProvider.GetService <BotServices>();
            _userState         = serviceProvider.GetService <UserState>();
            _responseManager   = serviceProvider.GetService <ResponseManager>();
            _conversationState = serviceProvider.GetService <ConversationState>();
            TelemetryClient    = telemetryClient;
            _stateAccessor     = _conversationState.CreateProperty <EmailSkillState>(nameof(EmailSkillState));

            _forwardEmailDialog = serviceProvider.GetService <ForwardEmailDialog>();
            _sendEmailDialog    = serviceProvider.GetService <SendEmailDialog>();
            _showEmailDialog    = serviceProvider.GetService <ShowEmailDialog>();
            _replyEmailDialog   = serviceProvider.GetService <ReplyEmailDialog>();
            _deleteEmailDialog  = serviceProvider.GetService <DeleteEmailDialog>();

            AddDialog(_forwardEmailDialog ?? throw new ArgumentNullException(nameof(_forwardEmailDialog)));
            AddDialog(_sendEmailDialog ?? throw new ArgumentNullException(nameof(_sendEmailDialog)));
            AddDialog(_showEmailDialog ?? throw new ArgumentNullException(nameof(_showEmailDialog)));
            AddDialog(_replyEmailDialog ?? throw new ArgumentNullException(nameof(_replyEmailDialog)));
            AddDialog(_deleteEmailDialog ?? throw new ArgumentNullException(nameof(_deleteEmailDialog)));

            GetReadingDisplayConfig();
        }