Mercurial > pub > ImplabNet
changeset 90:efcb076407a7 v2
code cleanup
author | cin |
---|---|
date | Sun, 12 Oct 2014 16:50:34 +0400 |
parents | ce0171cacec4 |
children | cdaaf4792c22 |
files | Implab/Safe.cs |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/Implab/Safe.cs Wed Oct 08 02:19:45 2014 +0400 +++ b/Implab/Safe.cs Sun Oct 12 16:50:34 2014 +0400 @@ -13,12 +13,17 @@ if (rx == null) throw new ArgumentNullException("rx"); if (!rx.IsMatch(param)) - throw new ArgumentException(String.Format("A prameter value must match {0}", rx), name); + throw new ArgumentException(String.Format("The prameter value must match {0}", rx), name); } public static void ArgumentNotEmpty(string param, string name) { if (String.IsNullOrEmpty(param)) - throw new ArgumentException("A parameter can't be empty", name); + throw new ArgumentException("The parameter can't be empty", name); + } + + public static void ArgumentNotEmpty<T>(T[] param, string name) { + if (param == null || param.Length == 0) + throw new ArgumentException("The array must be not emty"); } public static void ArgumentNotNull(object param, string name) {