| @@ -13,12 +13,17 namespace Implab | |||||
| 13 | if (rx == null) | 
             | 
        13 | if (rx == null) | |
| 14 | throw new ArgumentNullException("rx"); | 
             | 
        14 | throw new ArgumentNullException("rx"); | |
| 15 | if (!rx.IsMatch(param)) | 
             | 
        15 | if (!rx.IsMatch(param)) | |
| 16 | 
            
                            throw new ArgumentException(String.Format(" | 
        
             | 
        16 | throw new ArgumentException(String.Format("The prameter value must match {0}", rx), name); | |
| 17 | } | 
             | 
        17 | } | |
| 18 | 
             | 
        18 | |||
| 19 | public static void ArgumentNotEmpty(string param, string name) { | 
             | 
        19 | public static void ArgumentNotEmpty(string param, string name) { | |
| 20 | if (String.IsNullOrEmpty(param)) | 
             | 
        20 | if (String.IsNullOrEmpty(param)) | |
| 21 | 
            
                            throw new ArgumentException(" | 
        
             | 
        21 | throw new ArgumentException("The parameter can't be empty", name); | |
| 
             | 
        22 | } | |||
| 
             | 
        23 | ||||
| 
             | 
        24 | public static void ArgumentNotEmpty<T>(T[] param, string name) { | |||
| 
             | 
        25 | if (param == null || param.Length == 0) | |||
| 
             | 
        26 | throw new ArgumentException("The array must be not emty"); | |||
| 22 | } | 
             | 
        27 | } | |
| 23 | 
             | 
        28 | |||
| 24 | public static void ArgumentNotNull(object param, string name) { | 
             | 
        29 | public static void ArgumentNotNull(object param, string name) { | |
        
        General Comments 0
    
    
  
  
                      You need to be logged in to leave comments.
                      Login now
                    
                