Je dois implémenter un IExceptionHandler pour la bibliothèque Enteprise 4.1. Dans mon cas particulier, je veux l'utiliser pour enregistrer l'exception à Fogbugz mais les détails intérieurs ne sont pas ce que je demande. Ce dont j'ai besoin est comment - meilleures pratiques - l'implémenter, Comment obtenir la config pour un app.config ou web.config. etc.Bibliothèque d'entreprise Comment implémenter un IExceptionHandler?
je Code Ce jusqu'à présent:
public class LcpFogbugzExceptionHandler : IExceptionHandler {
/// <summary>
/// Initializes a new instance of the <see cref="LcpFogbugzExceptionHandler"/> class.
/// </summary>
public LcpFogbugzExceptionHandler() {
// <param name="ignore">The ignore.</param>
//NameValueCollection ignore
}
/// <summary>
/// Initializes a new instance of the <see cref="T:LcpFogbugzExceptionHandler"/> class.
/// </summary>
/// <param name="ignore">The ignore.</param>
public LcpFogbugzExceptionHandler(NameValueCollection ignore) {
}
/// <summary>
/// Handles the exception.
/// </summary>
/// <param name="exception">The exception.</param>
/// <param name="handlingInstanceId">The handling instance id.</param>
/// <returns></returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1300:SpecifyMessageBoxOptions"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Convert.ToBoolean(System.String)")]
public Exception HandleException(Exception exception, Guid handlingInstanceId) {
// Perform processing here. The exception returned will be passed to the next
// exception handler in the chain.
return exception;
}
}