protected RecurringBackgroundService(
     ILogger <RecurringBackgroundService> logger,
     IErrorReportingService errorReportingService)
 {
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
     _errorReportingService = errorReportingService ?? throw new ArgumentNullException(nameof(errorReportingService));
 }
 public VisualStudioErrorReportingServiceFactory(
     VisualStudioWorkspaceImpl workspace, 
     IForegroundNotificationService foregroundNotificationService,
     [ImportMany] IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> asyncListeners)
 {
     _singleton = new VisualStudioErrorReportingService(workspace, foregroundNotificationService, new AggregateAsynchronousOperationListener(asyncListeners, FeatureAttribute.InfoBar));
 }
예제 #3
0
 public VisualStudioErrorReportingServiceFactory(
     VisualStudioWorkspaceImpl workspace,
     IForegroundNotificationService foregroundNotificationService,
     [ImportMany] IEnumerable <Lazy <IAsynchronousOperationListener, FeatureMetadata> > asyncListeners)
 {
     _singleton = new VisualStudioErrorReportingService(workspace, foregroundNotificationService, new AggregateAsynchronousOperationListener(asyncListeners, FeatureAttribute.InfoBar));
 }
예제 #4
0
 public ExtensionManager(
     IOptionService optionsService,
     IErrorReportingService errorReportingService,
     IErrorLoggerService errorLoggerService,
     List <IExtensionErrorHandler> errorHandlers) : base(optionsService, errorReportingService, errorLoggerService, errorHandlers)
 {
     this.errorLoggerService = errorLoggerService;
 }
예제 #5
0
        public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
        {
            if (_singleton == null)
            {
                _singleton = new VisualStudioErrorReportingService(workspaceServices.GetRequiredService <IInfoBarService>());
            }

            return(_singleton);
        }
예제 #6
0
 public RequestAuditingFilter(
     IOptions <RequestAuditingFilterOptions> options,
     IRequestAuditingService requestAuditingService,
     IErrorReportingService errorReportingService)
 {
     _allowedMethods         = options.Value?.AllowedMethods ?? new[] { "POST", "PUT", "PATCH", "DELETE" };
     _requestAuditingService = requestAuditingService;
     _errorReportingService  = errorReportingService;
 }
예제 #7
0
 public ClaimsClientIdProvider(
     IHttpContextAccessor httpContextAccessor,
     IErrorReportingService errorReportingService,
     IOptions <ClientIdOptions> options)
 {
     _httpContextAccessor   = httpContextAccessor;
     _errorReportingService = errorReportingService;
     _options = options;
 }
예제 #8
0
 public ExtensionManager(
     IOptionService optionsService,
     IErrorReportingService errorReportingService,
     IErrorLoggerService errorLoggerService,
     List <IExtensionErrorHandler> errorHandlers)
 {
     _optionsService        = optionsService;
     _errorHandlers         = errorHandlers;
     _errorReportingService = errorReportingService;
     _errorLoggerService    = errorLoggerService;
 }
 public ExtensionManager(
     IOptionService optionsService,
     IErrorReportingService errorReportingService,
     IErrorLoggerService errorLoggerService,
     List<IExtensionErrorHandler> errorHandlers)
 {
     _optionsService = optionsService;
     _errorHandlers = errorHandlers;
     _errorReportingService = errorReportingService;
     _errorLoggerService = errorLoggerService;
 }
예제 #10
0
 public ExtensionManager(
     IGlobalOptionService globalOptions,
     IErrorReportingService errorReportingService,
     IErrorLoggerService errorLoggerService,
     List <IExtensionErrorHandler> errorHandlers)
 {
     _globalOptions         = globalOptions;
     _errorHandlers         = errorHandlers;
     _errorReportingService = errorReportingService;
     _errorLoggerService    = errorLoggerService;
 }
예제 #11
0
 public TokenRefresherService(
     IOptions <TokenRefreshOptions> options,
     ILogger <TokenRefresherService> logger,
     IServiceProvider serviceProvider,
     IErrorReportingService errorReportingService)
 {
     _options               = options.Value;
     _logger                = logger;
     _serviceProvider       = serviceProvider;
     _errorReportingService = errorReportingService;
 }
예제 #12
0
 public FriendlyExceptionsMiddleware(
     RequestDelegate next,
     IOptions <TranformOptions> options,
     ILogger <FriendlyExceptionsMiddleware> logger,
     IErrorReportingService errorReportingService)
 {
     _next    = next;
     _options = options;
     _logger  = logger;
     _errorReportingService = errorReportingService;
 }
예제 #13
0
        private static void Main(string[] args)
        {
            Console.WriteLine("Hi! This is an app to test how a service can record/report on some errors in a console/background application.");
            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();

            // Setup.
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            var configuration = builder.Build();
            var service       = configuration.GetSection("sampleService");

            Console.WriteLine($"Api key: {service["apiKey"]}");
            Console.WriteLine($"Secret: {service["secret"]}");

            _errorReportingService = new ExampleErrorReportingService(); // change to service being tested.

            // Go!
            ReportSomeErrorsAsync().Wait();
        }
예제 #14
0
 /// <summary>
 /// Производит инициализацию <see cref="SingletonErrorReporter"/>
 /// </summary>
 /// <param name="sendService">Сервис отправки сообщений</param>
 /// <param name="applicationInfo">Информация о приложении</param>
 /// <param name="logService">Сервис получения лога</param>
 /// <param name="databaseName">Имя текущей базы данных</param>
 /// <param name="canSendAutomatically">Если<c>false</c> и передаваемый в SendErrorReport() <see cref="ErrorReportType"/>, = <see cref="ErrorReportType.Automatic"/> то не отправляет сообщение об ошибке</param>
 /// <param name="autoSendLogRowCount">Если передаваемый в SendErrorReport() <see cref="ErrorReportType"/>, = <see cref="ErrorReportType.Automatic"/>, то отправляет на сервер такое количество лога по умолчанию</param>
 public static void Initialize(
     IErrorReportingService sendService,
     IApplicationInfo applicationInfo,
     ILogService logService    = null,
     string databaseName       = null,
     bool canSendAutomatically = false,
     int?autoSendLogRowCount   = null
     )
 {
     instance             = new SingletonErrorReporter();
     instance.sendService = sendService ?? throw new ArgumentNullException(nameof(sendService));
     if (applicationInfo == null)
     {
         throw new ArgumentNullException(nameof(applicationInfo));
     }
     instance.Edition              = applicationInfo.Edition;
     instance.Version              = applicationInfo.Version.ToString();
     instance.ProductName          = applicationInfo.ProductName;
     instance.DatabaseName         = databaseName;
     instance.logService           = logService;
     instance.CanSendAutomatically = canSendAutomatically;
     instance.autoSendLogRowCount  = autoSendLogRowCount;
 }
 public ErrorReportingWebService(IErrorReportingService errorReportingService)
 {
     this.errorReportingService = errorReportingService;
 }
예제 #16
0
 public BrokeredServiceConnection(TService service, SolutionAssetStorage solutionAssetStorage, IErrorReportingService errorReportingService)
 {
     _errorReportingService = errorReportingService;
     _solutionAssetStorage  = solutionAssetStorage;
     _service = service;
 }
예제 #17
0
 public ErrorReportingController(IErrorReportingService newsService)
 {
     this.service = newsService;
 }