Exemple #1
0
 /// <summary>
 /// Constructor accepting enumeration and message.
 /// </summary>
 /// <param name="exceptionEventCode">event enumeration that was defined in resource table</param>
 /// <param name="message">Specific message containing details of event</param>
 public ExceptionEvent(enumExceptionEventCodes exceptionEventCode, string message)
     : base(string.Format("{0}{1}{2}", exceptionEventCode.ToString()
                          , message
                          , Environment.NewLine))
 {
     _exceptionEventCode = exceptionEventCode;
     _exceptionCode      = Convert.ToInt32(exceptionEventCode);
     _msg         = message;
     _description = LookupDescription(exceptionEventCode);
     base.HResult = _exceptionCode;
 }
Exemple #2
0
 string LookupDescription(enumExceptionEventCodes exceptionEventCode)
 {
     try
     {
         return(EventCodes.ResourceManager.GetString(exceptionEventCode.ToString()));
     }
     catch (Exception e)
     {
         return(exceptionEventCode.ToString() + " was NOT found in the exception resource table." + e.Message);
     }
 }
Exemple #3
0
 /// <summary>
 /// Constructor accepting enumeration and message and an inner exception
 /// </summary>
 /// <param name="exceptionEventCode">event enumeration that was defined in resource table</param>
 /// <param name="description">Description of event or description</param>
 /// <param name="innerException">The exception object associated with the event.</param>
 public ExceptionEvent(enumExceptionEventCodes exceptionEventCode
                       , string description
                       , Exception innerException)
     : base(string.Format("{0}{1}{2}", exceptionEventCode.ToString()
                          , description
                          , Environment.NewLine)
            , innerException)
 {
     _exceptionEventCode = exceptionEventCode;
     _exceptionCode      = Convert.ToInt32(exceptionEventCode);
     _msg         = Message;
     _description = description;
     base.HResult = _exceptionCode;
 }