Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HistoryUpdateDialog"/> class.
        /// </summary>
        public HistoryUpdateDialog(IAppSettings configuration, ILogger <HistoryUpdateDialog> logger, ConversationState conversationState, HistoryReportService historyReportService, PrivateChat privateChat, IBackgroundQueue queue)
            : base(nameof(HistoryUpdateDialog), configuration.ConnectionName)
        {
            this.logger               = logger;
            this.privateChat          = privateChat;
            this.configuration        = configuration;
            this.queue                = queue;
            reportStateAccessor       = conversationState.CreateProperty <ReportParameters>(nameof(ReportParameters));
            this.historyReportService = historyReportService ?? throw new ArgumentNullException(nameof(HistoryUpdateDialog.historyReportService));

            AddDialog(new OAuthPrompt(
                          nameof(OAuthPrompt),
                          new OAuthPromptSettings
            {
                ConnectionName = ConnectionName,
                Text           = Resources.Strings.DialogAuthCardText,
                Title          = Resources.Strings.DialogSignInButton,
                Timeout        = configuration.SignInTimeout,
            }));

            // Steps of waterfall dialog
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                InitStepAsync,
                ReportScopeStepAsync,
                ReportTimeRangeStepAsync,
                ReportFileFormatStepAsync,
                ReportAuthCheckingStepAsync,
                PrepareReportAsync,
            }));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExtractHistoryMessagingExtension"/> class.
 /// </summary>
 /// <param name="configuration">The application configuration.</param>
 /// <param name="historyReportService">The history report service.</param>
 /// <param name="serviceScopeFactory">The service scope factory for getting scope inside background task.</param>
 /// <param name="privateChat">privateChat</param>
 /// <param name="queue">The queue.</param>
 /// <param name="logger">The logger.</param>
 /// <exception cref="ArgumentNullException">
 /// HistoryReportService
 /// or
 /// ConnectionName.
 /// </exception>
 public ExtractHistoryMessagingExtension(
     IAppSettings configuration,
     HistoryReportService historyReportService,
     IServiceScopeFactory serviceScopeFactory,
     PrivateChat privateChat,
     IBackgroundQueue queue,
     ILogger <ExtractHistoryMessagingExtension> logger)
 {
     HistoryReportService     = historyReportService ?? throw new ArgumentNullException(nameof(HistoryReportService));
     this.privateChat         = privateChat;
     this.connectionName      = configuration.ConnectionName ?? throw new ArgumentNullException("ConnectionName");
     this.queue               = queue;
     this.serviceScopeFactory = serviceScopeFactory;
     this.configuration       = configuration;
     this.logger              = logger;
 }