コード例 #1
0
        /// <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="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>
        public void Send(IReportSendEvent sendEvent = null, params Exception[] exceptions)
        {
            _info.SetExceptions(exceptions);

            var sender = new SenderFactory(_info, sendEvent ?? new SilentSendEvent()).Get();
            var report = new ReportGenerator(_info);

            sender.Send(report.Generate());
        }
コード例 #2
0
        /// <summary>
        /// Send the report without showing a dialog (silent send)
        /// <see cref="ExceptionReportInfo.SendMethod"/>must be SMTP or WebService, else this is ignored (silently)
        /// </summary>
        /// <param name="sendEvent">Provide implementation of IReportSendEvent to receive error/updates</param>
        /// <param name="exceptions">The exception/s to include in the report</param>
        public void Send(IReportSendEvent sendEvent = null, params Exception[] exceptions)
        {
            _reportInfo.SetExceptions(exceptions);

            var generator = new ReportGenerator(_reportInfo);
            var sender    = new SenderFactory(_reportInfo, sendEvent ?? new SilentSendEvent()).Get();

            sender.Send(generator.Generate().ToString());
        }
コード例 #3
0
        /// <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());
        }