コード例 #1
0
 /// <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;
 }
コード例 #2
0
        /// <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();
            }
        }
コード例 #3
0
 /// <summary>
 /// Initialise the ExceptionReporter
 /// </summary>
 public ExceptionReporter()
 {
     _info     = new ExceptionReportInfo();
     ViewMaker = new ViewMaker(_info);
 }
コード例 #4
0
 public Attacher(ExceptionReportInfo config)
 {
     _config = config;
 }
コード例 #5
0
 public SmtpMailSender(ExceptionReportInfo reportInfo, IReportSendEvent sendEvent) :
     base(reportInfo, sendEvent)
 {
 }
コード例 #6
0
 public ViewMaker(ExceptionReportInfo reportInfo)
 {
     _reportInfo = reportInfo;
 }
コード例 #7
0
 internal WebServiceSender(ExceptionReportInfo info, IReportSendEvent sendEvent)
 {
     _info      = info;
     _sendEvent = sendEvent;
 }