using System; using System.Collections.Generic; using System.Text; namespace Y.Utils.Net20.ListUtils { public sealed class ListTool { public static bool IsNullOrEmpty(List list) { if (list != null && list.Count > 0) return false; return true; } public static bool IsNullOrEmpty(List list) { if (list != null && list.Count > 0) return false; return true; } public static bool IsNullOrEmpty(IEnumerable list) { if (list != null) { foreach(var l in list) { return false; } } return true; } public static bool HasElements(IEnumerable list) { return !IsNullOrEmpty(list); } } }