using System; using System.Collections.Generic; using System.Text; namespace NameValueLib.BLL { /// <summary> /// Provides exception handling for name value library. /// </summary> /// <remarks> /// Created By: Yang Yu /// Create Date: April 10, 2008 /// </remarks> public class NameValueException :Exception { private const string ERROR_ID_KEY = "ErrorID"; #region properties /// <summary> /// Application Pre-Defined Error ID /// </summary> public int ErrorID { get { if(this.Data.Contains(ERROR_ID_KEY)) return (int)this.Data[ERROR_ID_KEY]; return 0; } set { if (this.Data.Contains(ERROR_ID_KEY)) this.Data[ERROR_ID_KEY] = value; else this.Data.Add(ERROR_ID_KEY, value); } } #endregion #region constructors public NameValueException() :base() { } public NameValueException(string Message) :base(Message) { } public NameValueException(string Message, Exception innerException) :base(Message, innerException) { } public NameValueException(string message, int errorID) :base(message) { this.ErrorID = errorID; } #endregion } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)