using System; namespace DTT.Utils.Exceptions { /// /// An exception used for when an argument was null or empty. /// public class NullOrEmptyException : RuntimeUtilityException { #region Variables #region Private /// /// The prefixed message in front of any /// /// private const string PREFIX = " - [A value was null or empty] - "; /// /// The suffix used to with the argument name. /// private const string SUFFIX = " was null or empty."; #endregion #endregion #region Constructors /// /// Create a with the given message /// to be preceded by the prefix. /// The message to show. /// public NullOrEmptyException(string nameOfArgument) : base(Format(PREFIX, nameOfArgument + SUFFIX)) { } /// /// Create a with the given message /// to be preceded by the prefix and inner exception. /// /// The message to show. /// The inner exception thrown. public NullOrEmptyException(string nameOfArgument, Exception innerException) : base(Format(PREFIX, nameOfArgument + SUFFIX), innerException) { } #endregion } }