public static void SubscribeToUnhadledExceptions(IErrorReportingSettings errorReportingSettings) { ErrorReportingSettings = errorReportingSettings ?? throw new ArgumentNullException(nameof(errorReportingSettings)); AppDomain.CurrentDomain.UnhandledException += delegate(object sender, UnhandledExceptionEventArgs e) { logger.Fatal((Exception)e.ExceptionObject, "Поймано необработаное исключение в Application Domain."); ErrorMessage((Exception)e.ExceptionObject); }; GLib.ExceptionManager.UnhandledException += delegate(GLib.UnhandledExceptionArgs a) { logger.Fatal((Exception)a.ExceptionObject, "Поймано необработаное исключение в GTK."); ErrorMessage((Exception)a.ExceptionObject); }; }
public ErrorMsgDlg(Exception exception, IApplicationInfo application, UserBase user, IErrorReportingSettings errorReportingSettings, IDataBaseInfo dataBaseInfo = null) { this.Build(); this.application = application; this.user = user; this.errorReportingSettings = errorReportingSettings ?? throw new ArgumentNullException(nameof(errorReportingSettings)); this.databaseInfo = dataBaseInfo; AppExceptions.Add(exception); OnExeptionTextUpdate(); buttonSendReport.Sensitive = false; entryEmail.Text = user?.Email; this.SetPosition(WindowPosition.CenterOnParent); textviewDescription.Buffer.Changed += InputsChanged; entryEmail.Changed += InputsChanged; }