/// <summary> /// constructor accepting a view and the data/config of the report /// </summary> public ExceptionReportPresenter(IExceptionReportView view, ExceptionReportInfo info) { _reportGenerator = new ReportGenerator(info); _fileService = new FileService(); View = view; ReportInfo = info; }
/// <summary> /// Initialises some ExceptionReportInfo properties related to the application/system /// </summary> /// <param name="reportInfo">an ExceptionReportInfo, can be pre-populated with config /// however 'base' properties such as MachineName</param> public ReportGenerator(ExceptionReportInfo reportInfo) { // this is going to be a dev/learning mistake - fail fast and hard _info = reportInfo ?? throw new ArgumentNullException(nameof(reportInfo)); _info.AppName = _info.AppName.IsEmpty() ? Application.ProductName : _info.AppName; _info.AppVersion = _info.AppVersion.IsEmpty() ? GetAppVersion() : _info.AppVersion; _info.ExceptionDate = _info.ExceptionDateKind != DateTimeKind.Local ? DateTime.UtcNow : DateTime.Now; if (_info.AppAssembly == null) { _info.AppAssembly = Assembly.GetEntryAssembly() ?? Assembly.GetCallingAssembly(); } }
/// <summary> /// Initialise the ExceptionReporter /// </summary> public ExceptionReporter() { _info = new ExceptionReportInfo(); ViewMaker = new ViewMaker(_info); }
public Attacher(ExceptionReportInfo config) { _config = config; }
public SmtpMailSender(ExceptionReportInfo reportInfo, IReportSendEvent sendEvent) : base(reportInfo, sendEvent) { }
public ViewMaker(ExceptionReportInfo reportInfo) { _reportInfo = reportInfo; }
internal WebServiceSender(ExceptionReportInfo info, IReportSendEvent sendEvent) { _info = info; _sendEvent = sendEvent; }