/// <summary> /// Send the report, asynchronously, without showing a dialog (silent send) /// <see cref="ExceptionReportInfo.SendMethod"/>must be SMTP or WebService, else this is ignored (silently) /// </summary> /// <param name="screenShooter">The screen-shotting code might be specific to WinForms, so this is an option to send anything that implements IScreenshooter</param> /// <param name="sendEvent">Provide implementation of IReportSendEvent to receive error/updates on calling thread</param> /// <param name="exceptions">The exception/s to include in the report</param> protected void Send(IScreenShooter screenShooter, IReportSendEvent sendEvent = null, params Exception[] exceptions) { _info.SetExceptions(exceptions); var sender = new SenderFactory(_info, sendEvent ?? new SilentSendEvent(), screenShooter).Get(); var report = new ReportGenerator(_info); sender.Send(report.Generate()); }
public void SetUp() { screenShooterMock = MockRepository.GenerateStrictMock<IScreenShooter>(); screenShooterMock.Expect(m => m.Capture("")).IgnoreArguments().Repeat.Once(); processHandlerStub = MockRepository.GenerateStub<IProcessHandler>(); processHandlerStub.Expect(m => m.GetCurrentProcess()).Return("process"); validator = new ProcessCaptureValidator(processHandlerStub, new string[] { "process" }); processRecorder = new ProcessRecorder( new RecordConfiguration() { Name = "", Path = "", Period = 1000 }, validator, screenShooterMock); }
public ProcessRecorder(RecordConfiguration configuration, ProcessCaptureValidator validator, IScreenShooter screenShooter) { Period = configuration.Period; RecordName = configuration.Name; Path = configuration.StoragePath; NumCaptures = 0; this.validator = validator; this.screenShooter = screenShooter; initTimer(); }
protected MailSender(ExceptionReportInfo reportInfo, IReportSendEvent sendEvent, IScreenShooter screenShooter) { _config = reportInfo; _sendEvent = sendEvent; _attacher = new Attacher(reportInfo, screenShooter); }
public MapiMailSender(ExceptionReportInfo reportInfo, IReportSendEvent sendEvent, IScreenShooter screenShooter) : base(reportInfo, sendEvent, screenShooter) { }
public ZipAttachmentService(IZipper zipper, IScreenShooter screenShooter, IFileService fileService) { Zipper = zipper; ScreenShooter = screenShooter; FileService = fileService; }
public Attacher(ExceptionReportInfo config, IScreenShooter screenShooter) { _config = config; ScreenShooter = screenShooter; }
public SenderFactory(ExceptionReportInfo config, IReportSendEvent sendEvent, IScreenShooter screenShooter) { _config = config; _sendEvent = sendEvent; _screenShooter = screenShooter; }