#region --------------- Copyright Dresser Wayne Pignone ------------- /* * $Log: /Wrk/WayneLibraries/Wrk/Log/LogException.cs $ * * 2 08-02-13 9:28 Mattias.larsson * FxCop fixes. */ #endregion using System; namespace Wayne.Lib.Log { /// /// General log exception. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")] public class LogException : Exception { #region Fields private LogExceptionType type; #endregion #region Construction /// /// Construction. /// public LogException(LogExceptionType type) { this.type = type; } /// /// Construction. /// public LogException(LogExceptionType type, string message) : base(message) { this.type = type; } /// /// Construction. /// public LogException(LogExceptionType type, string message, Exception inner) : base(message, inner) { this.type = type; } #endregion #region Properties /// /// The type of exception. /// public LogExceptionType LogExceptionType { get { return type; } } #endregion #region Methods /// /// The Message /// public override string Message { get { return string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}: \"{1}\"", type, base.Message); } } /// /// ToString. /// /// public override string ToString() { return string.Format(System.Globalization.CultureInfo.InvariantCulture, "LogException({0}){1}", type, base.ToString()); } #endregion } }