/// <summary> /// Send the report without showing a dialog (silent send) /// <see cref="ReportSendMethod"/>must be set to SMTP or WebService, else this is ignored (silently) /// </summary> /// <param name="exceptions">The exception/s to include in the report</param> public void Send(params Exception[] exceptions) { _reportInfo.SetExceptions(exceptions); var generator = new ExceptionReportGenerator(_reportInfo); if (_reportInfo.SendMethod == ReportSendMethod.WebService) { generator.SendReportToWebService(); } else if (_reportInfo.SendMethod == ReportSendMethod.SMTP || _reportInfo.MailMethod == ExceptionReportInfo.EmailMethod.SMTP) // backwards compatibility { generator.SendReportByEmail(); } else if (_reportInfo.SendMethod == ReportSendMethod.SimpleMAPI || _reportInfo.MailMethod == ExceptionReportInfo.EmailMethod.SimpleMAPI) // backwards compatibility { // this option must be last for compatibility because osbsolete MailMethod.SimpleMAPI was previously 0/default // can't do silently so do nothing } }
/// <summary> /// constructor /// </summary> public ExceptionReportPresenter(IExceptionReportView view, ExceptionReportInfo info) { _view = view; ReportInfo = info; _reportGenerator = new ExceptionReportGenerator(ReportInfo); }