# HG changeset patch # User cin # Date 2014-10-12 12:50:34 # Node ID efcb076407a741fa7a2a77905d0b90696a5601e4 # Parent ce0171cacec4901ab67b30524551fea7a4f0cf8c code cleanup diff --git a/Implab/Safe.cs b/Implab/Safe.cs --- a/Implab/Safe.cs +++ b/Implab/Safe.cs @@ -13,12 +13,17 @@ namespace Implab 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[] 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) {