IsEmpty() public static method

Determines whether the specified array is null or empty.
public static IsEmpty ( object array ) : bool
array object The array to check.
return bool
Exemplo n.º 1
0
 /// <summary>
 /// Find a value of one of the given types in the given Collection,
 /// searching the Collection for a value of the first type, then
 /// searching for a value of the second type, etc.
 /// </summary>
 /// <param name="collection">The collection to search.</param>
 /// <param name="types">The types to look for, in prioritized order.</param>
 /// <returns>a value of the given types found, or <code>null</code> if none</returns>
 /// <exception cref="ArgumentException">If more than one value of the given type is found</exception>
 public static object FindValueOfType(ICollection collection, Type[] types)
 {
     if (IsEmpty(collection) || ObjectUtils.IsEmpty(types))
     {
         return(null);
     }
     foreach (Type type in types)
     {
         object val = FindValueOfType(collection, type);
         if (val != null)
         {
             return(val);
         }
     }
     return(null);
 }