internal static void ForEach <TElem>(this IEnumerable <TElem> seq, Action <TElem> act) { IAnyIterable <TElem> elems = seq as IAnyIterable <TElem>; if (elems != null) { elems.ForEachWhile(item => { act(item); return(true); }); } else if (seq is TElem[]) { var arr = (TElem[])seq; for (var i = 0; i < arr.Length; i++) { act(arr[i]); } } else { var list = seq as List <TElem>; if (list != null) { list.ForEach(act); } else { ForEachWhile(seq, x => { act(x); return(true); }); } } }
public static void CheckNotEmpty <T>(this IAnyIterable <T> anyIterable) { if (anyIterable.IsEmpty()) { throw Errors.Is_empty; } }
internal static bool IsEmpty <T>(this IAnyIterable <T> seq) { return(seq.Length == 0); }
/// <summary> /// Constructs an IterableDebugView for the list. /// </summary> /// <param name="list"></param> public IterableDebugView(IAnyIterable <TElem> list) { Object = list; }
/// <summary> /// Constructs a debug view for the specified collection. /// </summary> /// <param name="list">The collection.</param> public SequentialDebugView(IAnyIterable <TElem> list) { zIterableView = new IterableDebugView <TElem>(list); }