123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- #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
- {
- /// <summary>
- /// General log exception.
- /// </summary>
- [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
- /// <summary>
- /// Construction.
- /// </summary>
- public LogException(LogExceptionType type)
- {
- this.type = type;
- }
- /// <summary>
- /// Construction.
- /// </summary>
- public LogException(LogExceptionType type, string message)
- : base(message)
- {
- this.type = type;
- }
- /// <summary>
- /// Construction.
- /// </summary>
- public LogException(LogExceptionType type, string message, Exception inner)
- : base(message, inner)
- {
- this.type = type;
- }
- #endregion
- #region Properties
- /// <summary>
- /// The type of exception.
- /// </summary>
- public LogExceptionType LogExceptionType
- {
- get { return type; }
- }
- #endregion
- #region Methods
- /// <summary>
- /// The Message
- /// </summary>
- public override string Message
- {
- get
- {
- return string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}: \"{1}\"", type, base.Message);
- }
- }
- /// <summary>
- /// ToString.
- /// </summary>
- /// <returns></returns>
- public override string ToString()
- {
- return string.Format(System.Globalization.CultureInfo.InvariantCulture, "LogException({0}){1}", type, base.ToString());
- }
- #endregion
- }
- }
|